Bar code scanner with laser power down feature

ABSTRACT

A proximity sensor receives light beams reflected from a goods. A proximity sensor control unit determines that the goods exists when a light quantity of the reflected light received by the proximity sensor exceeds a determination threshold value. The determination threshold value increases as elapsed time since the bar code was read last time becomes longer, and, as a result, a detection sensitivity decreases. A CPU restores a duty of irradiation of the laser beam back to 100% and resumes rotations of a motor for driving an operation optical system when the proximity sensor control unit determines that the goods exists.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to a bar code reading apparatusfor detecting variations in intensity of reflected light from a bar codewhich is irradiated with laser beams scanned by a scanning opticalsystem. The present invention relates more particularly to a bar codereading apparatus which can automatically decrease intensity of thelaser beams and stop the scanning by the scanning optical system whenunused.

2. Description of the Prior Art

A practice of managing merchandise and inventory by using bar codes hasbeen popularized in recent years as represented, for example by a POS(point-of-sale); system in a distribution business. For example, in aPOS system of a retail store, items of data such as kinds, sales prices,of the goods, etc. are encoded in a bar code format, and the encoded barcode is printed on the goods or printed on a lable affixed to the goods.Then, the bar code is read at a cash register, or posterminal and thepayment of the goods is made based on the read data. Subsequently, thenumbers of sales of the goods are determined in real time, which can beuseful for stocking, inventory, and purchasing management.

By the way, the above bar code reading apparatus for reading the barcode can be classified into a fixed type used when the goods arerelatively small and a hand-held type used when the goods are relativelylarge. The fixed type involves the use of a mechanism for scanning thebar code with irradiated light beams in multi-directions so that the barcode can be read even when the goods are set over the bar code readerwithout an operator being aware of a direction of the bar code. Morespecifically, the fixed type uses a polygon mirror and fixed reflectingmirrors in combination. Laser beams acting as reading irradiated lightbeams are reflected by a single reflection surface of the polygonmirror, during which these reflected light beams are sequentiallyincident upon a plurality of fixed reflecting mirrors in order anddeflected in a variety of directions for scanning. The bar code readingapparatus receives the reflected light beams from the surface of thegoods during such scanning, and decodes the data encoded in the bar codeon the basis of variations in intensity of the received light beams.

In this fixed type bar code reader, a laser diode used as a laser lightsource naturally has a finite usable life. Accordingly, if an emissionof the laser beams continues even in a standby where the reading of thebar code is not yet carried out although a power is supplied to thelaser reading apparatus, the laser diode might require frequentreplacement. Similarly, if the optical scanning system is constantlydriven, a fault is more likely to occur, and a large quantity ofelectric power is unnecessarily dissipated.

Conventional bar code reading devices have attempted to solve theseproblems by utilizing a trigger switch or an item sensor in the vicinityof a bar code reading position (which may be an external surface of aglass plate inset in an outer wall of the bar code reading apparatus sothat the laser beams penetrate it toward the outside). In theconventional bar code reading apparatus, an optical scanning system isdriven and the laser beams are emitted only when the goods is detectedby the trigger switch or the item sensor.

However, in cases where the goods are mechanically detected by thetrigger switch or the item sensor, the operator must take steps to makethe goods contact with the trigger switch or the item sensor. Hence, theoperator has to perform the reading operation while being aware of thetrigger switch or the item sensor.

SUMMARY OF THE INVENTION

It is a first object of the present invention, which was contrived inview of the above problems inherent in the prior art, to provide a barcode reading apparatus capable of efficiently starting an emission oflaser beams and starting the drive of a scan optical system withoutmaking a user aware of an existence of a sensor. The invention has aconstruction which can optically detect an object marked with a barcode.

If a detecting apparatus for detecting an existence of an object in thevicinity of the bar code reading position based on from variations in areceived light quantity is used, the apparatus can be offered at a lowprice. However, in this case, the object which detected is not alwaysnecessarily a commercial goods or an item which is intended to bescanned. By the way, if a time period since the goods has been oncedetected is short, there is a high possibility that the goods may bere-detected. Further, even if the irradiation of the laser beams and thedrive of the scan optical system are restarted due to a misdetection,and if the goods is exposed to the laser beam in the bar code readingposition during the restarted irradiation of the laser beams, thisresumption of the irradiation of the laser beam is not useless.

It is a second object of the present invention to provide a bar codereading apparatus that decreases a sensitivity when detecting an objectin accordance with a length of a time period for which the reading ofthe-bar code is interrupted after once reading the bar code to reducetroubles or errors caused by the misdetection.

To accomplish the first and second objects of the invention, a bar codereading apparatus according to the present invention adopts thefollowing constructions.

In a first aspect of a bar code reading apparatus of the presentinvention, a bar code reading apparatus comprises. A laser light sourcefor emitting laser beam, a scan optical system is provided fordeflecting the laser beams toward a read position, and a demodulatingelement is provided for demodulating data encoded in a bar code markedon an object disposed in the read position on the basis of a reflectedbeam of the laser beam reflecting on the bar code. The bar code readingapparatus also comprises a power changing element for changing power ofthe laser beam from a normal level after a predetermined time haselapsed since the demodulating element performed the demodulation lasttime, and an optical sensor optically detecting an object disposed inthe read position. The bar code reading apparatus further comprises arestoring element for restoring the power of the laser beams to thenormal level when the optical sensor detects an object, and asensitivity decreasing element for decreasing a sensitivity of theoptical sensor in accordance with the elapsed time since thedemodulating element performed the demodulation last time.

According to the first aspect of the bar code reading apparatus of thepresent invention, the laser light source emits the laser beam. The scanoptical system rotates and deflect the laser beams toward the readposition. The demodulating element detects the reflected beam of thelaser beam reflected on the bar code marked on the object disposed inthe read position, and demodulates the data encoded in the bar code. Thepower changing element changes power of the laser beam emitted from thelaser light source from the normal level after the predetermined timehas elapsed since the demodulating element performed the demodulationlast time. The optical sensor optically detects an object disposed inthe read position. When the optical sensor detects an object, therestoring element restores the power of the laser beams emitted from thelaser light source to the normal level. The sensitivity decreasingelement decreases the sensitivity of the optical sensor in accordancewith the elapsed time since the demodulating element performed theprevious demodulation. Accordingly, when the elapsed time since thedemodulation has been previously performed is not so long, there must bea relatively small -possibility of misdetecting an object other than theobject marked with the bar code even if the detection sensitivity isincreased because of such a high possibility that the bar code can beread. Further, it is possible to prevent a failure of detecting theobject marked with the bar code by increasing the detection sensitivity.Moreover, when the elapsed time since the demodulation was carried outlast time is extended the possibility of the bar code being read isreduced. Therefore, it is feasible to minimize the possibility ofmisdetecting the object excluding the object marked with the bar codewith the sensitivity decreased. The

The laser light source may be a semiconductor laser, i.e., a laser diodeor a solid-state laser.

The read position defines an are a in which the bar code can be read asfar as the bar code exists in the particular position. The read positionmay be set upwardly of the scan optical system or may be set sideways ofthe scan optical system. Further, there may be provided a wall surface,e.g., a glass window, which defines a boundary surface of the readposition.

The scan optical system is an optical system including a polygon mirroror a galvano mirror capable of deflecting the laser beams by itsrotation.

The demodulating element can be constructed to detect the variations inthe intensity of the reflected light beams from the bar code, to measurea width of each of bars constituting the bar code on the basis of thevariations in the intensity thereof, to read the a pattern of the barcode on the basis of the bar widths measured, and convert the thus readpattern into corresponding data.

The power changing element is an element for changing a magnitude of thepower of the laser beam. This "change" includes changing the magnitudethereof without stopping the emission of the laser beams or completelystopping emission of the laser beams. Further, the power changingelement may consecutively gradually change the magnitude of the power ormay stepwise change it at fixed time interval. This "change" includes anattenuation of an instant value itself of the laser beam or reducingduty of emission of a laser beam in the unit time.

The optical sensor may have a construction wherein a light emittingelement and a light receiving element are disposed side by side frontingthe read position, whereby an object is detected on the assumption thatan object exists when receiving the reflected light beams from thesurface of the object. The optical sensor may also have a constructionwherein the light emitting element and the light receiving element aredisposed with the read position interposed therebetween, whereby anobject is detected on the assumption that an object exists when thelight beams emitted from the light emitting element and incident uponthe light receiving element are intercepted by the object. In thosecases, it is desirable that-a light receiving surface of the lightreceiving element is covered with a filter which transmits only thelight beams having a specified wavelength that is same as that of thelaser beam emitted from the light emitting element so that thevariations in the external light beams do not exert any influence on aresult of the detection. Further, the optical sensor may take such aconstruction that only the light receiving element is disposed to frontthe read position, whereby an object is detected on the assumption thatan object exists when the external light beams incident upon the lightreceiving element via the read position are intercepted by the object.In this case, it is desirable that a frequency characteristic of thelight receiving element be flat in a visible area.

The restoring element restores the power of the laser beams to a levelof a status before the power changing element changes the magnitude ofthe power. The restoring element may restore the magnitude of the powerof the laser beams also when the demodulating element demodulates thebar code or when the optical sensor detects an object.

The sensitivity decreasing element may consecutively gradually decreasethe sensitivity or may stepwise decrease the sensitivity at an intervalof a fixed time. In the case of decreasing the sensitivity stepwise atthe interval of the fixed time, this process may be execute insynchronization with the stepwise changing of the power by the powerchanging element. The sensitivity decreasing element desirably sets thesensitivity of the optical sensor back to the previous sensitivity whenthe restoring element restores the power of the laser beams.

In a second aspect of the bar code reading apparatus of the presentinvention, a bar code reading apparatus comprises a laser light sourcefor emitting a laser beam. A scan optical element rotates to deflect thelaser beam toward a read position, and a driving element drives the scanoptical element, A demodulating element a demodulating elementdemodulates data encoded in a bar code marked on an object disposed inthe read position on the basis of a reflected beam of the laser beamreflected on the bar code. The bar code reading apparatus also comprisesa control element for at first changing power of the laser beam from anormal level, then stopping an emission of the laser beams from thelaser light source. Subsequently, the driving of the scan opticalelement by the driving element is stopped in accordance with an elapsedtime since the demodulating element previously performed thedemodulation. The bar code reading apparatus further comprises anoptical sensor optically detecting an object disposed in the readposition, a restoring element for restoring the power of the laser beamsto the normal level, and restoring the driving of the scan opticalelement by the driving element when the optical sensor detects anobject. A sensitivity decreasing element decreases stepwise sensitivityof the optical sensor respectively when the power of the laser beams ischanged from the normal level, when the emission of the laser beams isstopped, and when the driving of the scan optical member is stopped.

According to the second aspect of the bar code reading apparatus of thepresent invention, the laser light source emits the laser beams. Therotating scan optical element rotates and deflects the laser beamstoward the read position. The driving element rotationally drives thisscan optical element. The demodulating element demodulates the dataencoded in.the bar code on the basis of the reflected light beams of thelaser beams falling on the bar code marked on the object disposed in theread position. The control element at first changes the power of thelaser beams emitted from the laser light source from the normal level,then stops the emission of the laser beams emitted from the laser lightsource, and subsequently stops the driving of the scan optical elementby the driving element, in accordance with the elapsed time since thedemodulating element previously performed the demodulation. The opticalsensor optically detects an object disposed in the read position. Therestoring element, when the optical sensor detects the object, restoresthe power of the laser beams emitted from the laser light source to thenormal level and restores the driving of the scan optical element by thedriving element. The sensitivity decreasing element, when the power ofthe laser beams is chreduces the sensormal level, reduces thesensitivity of the optical sensor by one step. The sensitivitydecreasing element, when the emission of the laser beams is stopped,reduces the sensitivity by. further one step. The sensitivity decreasingelement, when the drive of the scan optical element is stopped, furtherreduces the sensitivity by one step. When the power of the laser beamsis simply changed, there must be a comparatively low possibility ofmisdetecting the object other than the object marked with the bar codeeven if the detection sensitivity is high because of such a highpossibility that the bar code can be read. Furthermore, it is feasibleto prevent a failure of detection the object marked with the bar code byincreasing the sensitivity. Additionally, when the emission of the laserbeams is simply stopped, there is decreased a possibility that the barcode can be, read, and it is therefore feasible to restrain thepossibility of misdetecting the object other than the object marked withthe bar code by reducing the sensitivity. Further, when the driving ofthe optical element is also halted, the possibility that the bar codecan be read is further decreased, and hence it is feasible to restrainthe possibility of misdetecting the object other than the object markedwith the bar code by further reducing the detection sensitivity.

The scan optical element is a polygon mirror or galvano mirror capableof deflecting the laser beams by its rotation.

According to a third aspect of the bar code reading apparatus of thepresent invention, a bar code reading apparatus further comprises afrequency measuring element for measuring a frequency at which thedemodulating element demodulates the data. The sensitivity decreasingelement decreases the sensitivity by the optical sensor each time thefrequency measured by the frequency measuring element decreases andincreases the detection sensitivity by the optical sensor each time thefrequency increases. If a data demodulation frequency is high, thepossibility of reading the bar code is high, and hence, even if thesensitivity is high, there must be a comparatively low possibility inwhich the object other than the object marked with the bar code ismisdetected. Moreover, the failure of detecting the object marked withthe bar code is prevented by increasing the sensitivity. Furthermore, ifthe data demodulation frequency is low, the possibility of misdetectingthe object other than the object marked with the bar code is restrainedby decreasing the sensitivity is low since there must be a lowpossibility of reading the bar code.

According to a fourth aspect of the bar code reading apparatus of thepresent invention, the sensitivity decreasing element includes a tablein which a combination of the elapsed time since the demodulatingelement executed the demodulation last time and the frequency measuredby the frequency measuring element is made to correspond to sensitivityof the-optical sensor and reads the sensitivity out this table. If thetable is thus, prepared, an optimum sensitivity can be easily set inconsideration of the-elapsed time and the frequency in use.

According to a fifth aspect of the bar code reading apparatus of thepresent invention, the optical sensor includes a light emitting elementfor irradiating an object disposed in the read position with the lightbeams and a light receiving element for receiving the light beamsreflected from the object. The light emitting element and lightreceiving element are disposed side by side.

According to a sixth aspect of the bar code reading apparatus of thepresent invention, the optical sensor detects external light incidentvia the read position which is intercepted by the object.

According to a seventh aspect of the bar code reading apparatus of thepresent invention, the optical sensor compares an average of lightquantities obtained by measuring the external light beams several timeswith a latest external light quantity. The optical sensor assumes anobject detected when a rate of the latest external light quantity to theaverage is a predetermined level or under. With this construction, thereis no necessity of setting a fixed determination reference value, andhence the object can be detected irrespective of a brightness of a placewhere the bar code reading apparatus is employed.

According to an eighth aspect of the bar code reading apparatus of thepresent invention, an external light quantity measurement interval forobtaining the average is set larger that a measurement interval formeasuring the latest external light quantity.

According to a ninth aspect of the bar code reading apparatus of thepresent invention, the average of light quantities obtained by measuringthe external light beams several times is compared with a second averageof light quantities obtained by measuring the latest external lightquantities several times. If constructed in this way, an influence by aninstant value which has no direct connection with an actual detection ofthe object can be effectively eliminated.

According to a tenth aspect of the bar code reading apparatus of thepresent invention, the power changing element changes a power of thelaser beams only when the average of the light quantities obtained bymeasuring the external light am several times is less than apredetermined level. With this construction, when the average value ofthe external light quantity is equal to or more than the predeterminedvalue, the power of the laser beams can be kept, and hence there is nonecessity for detecting the variations in the external light beams.Accordingly, the optical sensor is prevented from misdetecting theobject.

According to an eleventh aspect of the bar code reading apparatus of thepresent invention, the power changing element changes power of the laserbeams only when the average of the light quantities obtained bymeasuring the external light beams several times is larger than apredetermined level. Due to this construction, if the average quantityof the external light quantity is equal to or more than thepredetermined value, the power of the laser beams can be maintained, andhence, there is no necessity for detecting the variations in theexternal light beams. Accordingly, misdetection of the object by theoptical sensor is prevented.

In a twelfth aspect of the bar code reading apparatus of the presentinvention, a bar code reading apparatus comprises a laser light sourcefor emitting laser beam, a scan optical system deflecting the laserbeams toward a read position, and a demodulating element fordemodulating data encoded in a bar code marked on an object disposed inthe reading position on the basis of a reflected beam of the laser beamreflected on the bar code. The bar code reading apparatus also comprisesa power changing element for changing power of the laser beam from anormal level after a predetermined time has elapsed since thedemodulating element performed the demodulation last time, an opticalsensor for optically detecting the object disposed in the read position,and a restoring element for restoring the power of the laser beams tothe normal level when the optical sensor detects an object. The bar codereading apparatus further comprises a sensitivity decreasing element fordecreasing sensitivity of the optical sensor in accordance with thenumber of times with which the optical sensor detects an object withoutany demodulation executed by the demodulating element.

According to the twelfth aspect of the bar code reading apparatus of thepresent invention, the laser light source emits the laser beam. The scanoptical system relates and deflects the laser beams toward the readposition. The demodulating element demodulates the data encoded in thebar code on the basis of the reflected light of the laser beamsreflected on the bar code marked on the object disposed in the readposition. The power changing element changes power of the laser beamemitted from the laser light source from the normal level after thepredetermined time has elapsed since the demodulating element performedthe demodulation last time. The optical sensor optically detects anobject disposed in the read position. When this optical sensor detectsan object, the restoring element restores the power of the laser beamemitted from the laser light source to the normal level. The sensitivitydecreasing element decreases the sensitivity of the optical sensor inaccordance with the number of times with which the optical sensordetects the object without any demodulation performed by thedemodulating element. Immediately after effecting the demodulation,there must be a high possibility that the bar code can be read. Hence,even if the detection sensitivity is set high, there must be acomparatively low possibility of misdetecting the object other than theobject marked with the bar code. Further, the failure of detecting theobject marked with the bar code is prevented by increasing the detectionsensitivity. Contrastingly, the case that the optical sensor detects anobject without any demodulation executed by the demodulating element ismisdetection, and therefore, the possibility of misdetecting the objectother than the object marked with the bar code is restrained bydecreasing the detection sensitivity.

In a thirteenth aspect of the bar code reading apparatus of the presentinvention, a bar code reading apparatus comprises a laser light sourcefor emitting a laser beam, a scan optical element rotating to deflectthe laser beam toward a read position, a driving element for driving thescan optical element, and a demodulating element for demodulating dataencoded in a bar code marked on an object disposed in the read positionon the basis of a reflected beam of the laser beam reflected on the barcode. The bar code reading apparatus also comprises a control elementfor at first changing power of the laser beam from a normal level, nextstopping an emission of the laser beam from the laser light source, andsubsequently stopping the driving of the scan optical element by thedriving element in accordance with an elapsed time since thedemodulating element performed the demodulation last time. The bar codereading apparatus further comprises an optical sensor for opticallydetecting an object disposed in the read position, a restoring elementfor restoring the power of the laser beams to the normal level, andresetting the drive of the scan optical element by the driving elementwhen the optical sensor detects an object, and a time shortening elementfor shortening a time until the emission of the laser beams is stoppedwhen the being optical sensor detects an object without any demodulationexecuted by the demodulating element.

According to the thirteenth aspect of the bar code reading apparatus ofthe present invention, the laser light source emits laser beams. Thescan optical element rotates and deflects the laser beams toward theread position. The driving element rotationally drives the scan opticalelement. The demodulating element demodulates the data encoded in thebar code marked on the object disposed in the read position on the basisof reflected beams of the laser beams reflected on the bar code. Thecontrol element at first changes the power of the laser beams emittedfrom the laser light source from the normal level, next stops theemission of the laser beams emitted from the laser light source, andsubsequently stops the driving of the scan optical element by thedriving element, in accordance with the elapsed time since thedemodulating element performed the demodulation last time. The opticalsensor optically detects an object disposed in the read position. Therestoring element restores the power of the laser beams emitted from thelaser light source to the normal level, and restores the driving of thescan optical element by the driving element when the optical sensordetects the object. The time shortening element shortens a time untilthe emission of the laser beams emitted from the-laser light source isstopped when the optical sensor detects an object without anydemodulation executed by the demodulating element. Since the case thatthe optical sensor detects an object without any demodulation effectedby the demodulating element is misdetected, the laser beams areprevented from being emitted with a futility by reducing the time untilthe output of the laser beams is stopped in such a case.

In a fourteenth aspect of t he bar code reading apparatus of the presentinvention, a bar code reading apparatus comprises a laser light sourcefor emitting a laser beam, a scan optical element rotating to deflectthe laser beam toward a read position, a driving element for driving thescan optical element, and a demodulating elements for demodulating dataencoded in a bar code marked on an object disposed in-the read positionon the basis of a reflected beam of the laser beams reflected on the barcode. The bar code reading apparatus also comprises a control elementfor at first changing power of the laser beam from a normal level, thennext stopping an emission of the laser beam from the laser light source.Subsequently, the driving of the scan optical element by the drivingelement is stopped in accordance with an elapsed time since thedemodulating element performed the demodulation last time. The bar codereading apparatus further comprises an optical sensor opticallydetecting an object disposed in the read position, a restoring elementfor restoring the power of the laser beam to the normal level, andrestoring the driving of the scan optical element by the driving elementwhen the optical sensor detects an object. The bar code readingapparatus further comprises a time shortening element for shortening,when the optical sensor. detects an object without any demodulationexecuted by the demodulating element, a time until power of the laserbeam is changed, a time until the emission of the laser beam is stopped,and a time until the driving of the scan optical element by the drivingelement is stopped.

According to the fourteenth aspect of the bar code reading apparatus ofthe present invention, the laser light source emits laser beams. Thescan optical element rotates and deflects the laser beams towardthe-read position. The driving element rotationally drives the scanoptical element. The demodulating element demodulates data encoded inthe bar code marked on an object disposed in the read position on thebasis of reflected light beams of the laser beams reflected on the barcode. The control element at first changes the power of the laser beamsemitted from the laser light source from the normal level, next stops anemission of the laser beams emitted from the laser light source, andsubsequently stops the driving of the scan optical element by thedriving element, in accordance with an elapsed time since thedemodulating element performed the demodulation last time. The opticalsensor optically detects an object disposed in the read position. Therestoring element restores the power of the laser beams emitted from thelaser light source to the normal level, and restores the driving of thescan optical element by the driving element, when the optical sensordetects the object. The time shortening element shortens, when theoptical sensor detects an object without any demodulation executed bythe demodulating element, a time until the power of the laser beamsemitted from the laser light source is changed, a time until theemission of the laser beams emitted from the laser light source isstopped. The time shortening element also shortens a time until thedriving of the scan optical element by the driving element is stopped.Beams are prevented from being, unnecessary emitted with the time isreduced until the driving of the, scan optical element is stopped,whereby the scan optical member is prevented from being unnecessarilydriven by the driving element.

BRIEF DESCRIPTION THE DRAWINGS

The present invention will become more fully understood from thedetailed description given hereinbelow and the accompanying drawingswhich are given by way of illustration only, wherein:

FIG. 1 is a perspective view illustrating a bar code reading apparatusin a first embodiment of the present invention;

FIG. 2 is e block diagram illustrating an internal circuit of the barcode reading apparatus shown in FIG. 1;

FIG. 3 is a flowchart showing a using frequency detecting processexecuted by a CPU shown in FIG. 2;

FIG. 4 is a flowchart showing a bar code demodulating process and alaser scan control process that are executed, by the CPU shown in FIG.2;

FIG. 5 is a determination threshold value table stored in a ROM shown inFIG. 2;

FIG. 6 is an explanatory diagram showing variations in reflected lightquantity;

FIG. 7 is an explanatory diagram showing action in the first embodimentof the present invention;

FIG. 8 is a determination threshold value table stored in the ROM shownin-FIG. 1 in a second embodiment of the present invention;

FIG. 9 is an explanatory diagram showing variations in external lightquantity;

FIG. 10 is an explanatory diagram showing action in, the secondembodiment of the present invention;

FIG. 11 is a flowchart showing a bar code demodulating process and alaser scan control process in a third embodiment of the presentinvention;

FIG. 12 is a flowchart showing a bar code demodulating process and thelaser scan control process in a fourth embodiment of the presentinvention;

FIG. 13 is a flowchart showing a bar code demodulating process and thelaser scan control process in a fifth embodiment;

FIG. 14 is a flowchart showing a bar code demodulating process and thelaser scan control process in a sixth embodiment of the presentinvention;

FIG. 15 is a flowchart showing a bar code demodulating process and thelaser scan control process in a seventh embodiment of the presentinvention;

FIG. 16 is a flowchart showing a bar code demodulating process and thelaser scan control process in an eighth embodiment; and

FIG. 17 is a perspective view showing another form of a cash registerapparatus to which the bar code reading apparatus of the presentinvention is applied.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Next, embodiments of the present invention will. hereinafter bediscussed with reference to the

(Whole Construction of Bar Code Reading Apparatus)

FIG. 1 is a perspective view showing an appearance of a bar code readingapparatus in accordance with a first embodiment of the presentinvention. Referring to FIG. 1, a bar code reading apparatus 10 isconstructed on an upper surface 23 of a cash register apparatus for, asan example a supermarket. This upper surface 23 is formed as a flatsurface enabling a user to slidably move a goods 20 in an arroweddirection (from right to left in FIG. 1) by hand. The bar code readingapparatus 10 is disposed at a side edge portion of the supper surface 23of the cash register apparatus so that a surface formed with a glasswindow 11 fronts a central portion of the upper surface 23, whereby thebar code reading apparatus 10 is capable of reading a bar code 21printed on the surface of the goods 20 that is slidably moved. Morespecifically, the glass window formed in the bar code reading apparatus10 transmits laser beams L, with which the goods 20 is scanned in avertical direction, emitted toward the central portion of the suppersurface 23 of the cash register apparatus. The same glass window 11 alsotransmits the laser beams L reflected from the surface of the goods 20toward an interior thereof.

Further, a proximity sensor 8 is provided on the right side (i.e., on anupstream side of the sliding moving direction as indicated by an arrowof the goods) of the glass window 11 and in a position having the sameheight as the mid-part of the glass window 11. This proximity sensor 8is constructed of a light emitting diode for emitting infrared rayshaving a specified wavelength toward the central portion of the uppersurface 23 of the cash register apparatus, and of a photo diode coveredwith a filter that transmits only the light beams having that specifiedwavelength. These diodes are arranged in a side-by-side relationship.The proximity sensor 8, when an object (such as the goods 20, etc.) isplaced on the upper surface 23 of the cash register apparatus in frontof this proximity sensor 8, receives the infrared rays having thespecified wavelength, which are emitted from the light emitting diodeand reflected from the surface of the object. The proximity sensor thusdetects an existence of this object. Namely, the proximity sensor 8 isdefined as a reflection type optical sensor.

Next, internal circuits of the bar code reading apparatus 10 will beexplained with reference to the block diagram of FIG. 2. Connected tothe proximity sensor 8 is a proximity sensor control unit 7 to which aCPU 1 is connected. Connected additionally to the CPU 1 are a RAM 2, astorage and learning unit 3, a timer unit 4, a ROM 5, an auto-offcontrol unit 6, an interface circuit 9, a motor 12, a laser light source13 and a light receiving element 18.

The above-mentioned proximity sensor control unit 7 supplies the lightemitting diode of the proximity sensor 8 with a driving electriccurrent. The proximity sensor control unit 7 always monitors a photocurrent of the photo diode of the proximity sensor 8 and checks whetherthis photo current exceeds a predetermined threshold value. Then, if thephoto current exceeds the predetermined threshold value, the proximitysensor control unit 7 notifies the CPU 1 of the effect that the object(such as the goods 20, etc.) exists in front of the proximity sensor 8.The above threshold value is not constant or fixed, but is variablecorresponding to an instruction given from the CPU 1. As a result, ifthe threshold value goes higher, a determination that the object mustexist is harder to be made, and a detection sensitivity decreases.Contrastingly, if the threshold value goes lower, the determination thatthe object must exist is easier to be made, and the detectionsensitivity increases.

A variable range of the threshold value will be explained with referenceto FIG. 6. Now, it is assumed that the goods 20 exhibiting a highsurface reflectivity is placed on the upper surface 23 of the cashregister apparatus in front of the proximity sensor 8. At this time, ifa quantity of light received by the photo diode of the proximity sensor8 is conceived as a maximum light quantity receivable by the same photodiode, the photo current outputted from the photo diode can be conceivedto have a maximum value of the photo current that can be outputted fromthe same photo diode. Accordingly, the quantity of the light (which isthe photo current) received at that time can be conceived as a 100%light quantity as illustrated in FIG. 6. The threshold value set in theproximity sensor control unit 7 is set lower than 100% in considerationof a case where the surface reflectivity of the goods is low, a casewhere the surface of the goods is an irregular reflecting surface, and acase where the surface of the goods is obliquely directed to theproximity sensor. On the other hand, if the threshold value is set toolow, it follows that even the light beams reflected from clothing of anoperator standing in front of the cash register apparatus and from awall might be detected. It is therefore impossible to set the thresholdvalue too low. Taking the above-mentioned into consideration, inaccordance with this embodiment, the determination threshold value inthe proximity sensor control unit 7 is set in the vicinity of values of10%-50%. This value of 50% is the maximum threshold value with which theexistence of the goods can be checked even if the surface reflectivityof the goods is low or if the goods is placed in an oblique direction,as far as the goods exists in front of the proximity sensor 8 on thecash register apparatus surface 23. Further, the value of 10% is theminimum threshold value with which to prevent a detection of thereflected light beams from the wall and from the clothing of theoperator standing in front of the cash register apparatus. Those valuesonly 10%-50% are, however, of one example of the set values, and valuesother than those values may be set depending on conditions.

The motor or driving element 12 rotates a polygon mirror (not shown)which is a scan optical member constituting the scan optical system 14.Further, the laser light source 13 is defined as a laser diode foremitting the laser beams L. The laser beams L emitted from the laserlight source 13 fall upon the scan optical system 14 by which the laserbeams are deflected. Scans using the laser beams L are performed by thepolygon mirror rotationally driven by the motor 12 within the scanoptical system 14. When the laser beams L used for the scan fall on thesurface (including the bar code 21) of the goods 20, the laser beams Lare irregularly reflected at this surface, and some of the reflectedlight beams R are received by the light receiving element or photo diode18. A bar width counter 16 measures a width of each of bars constitutingthe bar code 21 on the basis of variations in intensity of the photocurrent outputted from the light receiving element 18 and calculates anitem of data (which is hereinafter termed "bar width data")corresponding to this measured bar width.

Further, the CPU 1 controls the whole bar code reading apparatus andalso demodulates the data encoded in the bar code 21 on the basis of thebar width data outputted from the bar width counter 16. Moreover, theCPU 1 changes the determination threshold value set in the aboveproximity sensor control unit 7 in accordance with a predeterminedalgorithm, and also issues a control instruction to the auto-off controlunit 6. Namely, the CPU 1 constitutes a demodulating element incombination with the light receiving element 18 and the bar widthcounter 16. Further, the CPU 1 also corresponds to a control element, arestoring element (which is an restoring element), a sensitivitydecreasing element and a time setting element.

The ROM 5 is a read-only memory stored with programs for a bar codedemodulating process and a determination threshold value changingprocess that are executed by the CPU 1 and with a determinationthreshold value table shown in FIG. 5. This determination thresholdvalue table is a table in which combinations of a variable x and avariable y are made corresponding to the determination threshold values.

The interface circuit 9 is an input/output circuit for connecting theCPU 1 to a host computer 22 installed in a computing center. Theinterface circuit 9 makes the CPU 1 to be inputted with a controlcommand from the host computer 22 and transmits the data from the CPU 1to the host computer 22.

The timer unit 4 is a hardware for generating time data used for thedetermination threshold value changing process executed by the CPU 1.

The RAM 2 is a memory for temporarily storing the data demodulated as aresult of the bar code demodulating process executed by the CPU 1.

The storage and learning unit 3 is a memory for storing a frequency inuse of the bar code demodulating apparatus 10. This frequency isindicated with the number of bar codes demodulated by the CPU 1 within afixed period.

The auto-off control-unit, or power changing 6 reduces a duty ofirradiation of the laser beams L emitted from the laser light source 13by half, completely stops the emission thereof and halts the rotationsof the motor 12 in accordance with the control of the CPU 1. Note thatthe "duty of irradiation" herein indicates a ratio of time for which thelaser beams L are irradiated within a unit time. Hence, a duty ofirradiation of 50% indicates that the laser beams L are evenly turnedON-OFF at an equal interval of a minute time. The duty of irradiation isthus reduced, so that the output of the laser beams L within the unittime is attenuated.

If the auto-off control unit 6 completely stops the laser beams L, thelaser light source 13 is supplied with absolutely no driving current, sothat unnecessary dissipation of the electric power is thereby prevented.If the duty of irradiation of the laser beams L is reduced down to 50%,a usable life of the laser light source 13 is extended. In this case,the laser light source 13 remains in an excited state, and therefore,when the proximity sensor 8 detects the goods 20, the duty ofirradiation of the laser beams L is immediately returned to 100% withthe result that stable irradiation of the laser beams L is performed.

Next, there will be described processes for the bar code demodulationand changing the determination threshold value, which are executed bythe CPU 1 with reference to flowcharts of FIGS. 3 and 4. The processesshown in the flowcharts of FIGS. 3 and 4 respectively start with a powersupply to the bar code reading apparatus, which executed virtually inparallel.

FIG. 3 shows the processes for measuring the frequency in use at theinterval of a fixed time (e.g., 10 minutes), and comparing the frequencynow measured with the frequency that has been recently stored in thestorage learning unit 3. The variable y is changed for referring to thedetermination frequency table shown in FIG. 5 in accordance with amagnitude of a difference therebetween, storing the storage and learningunit 3 with the thus measured frequency.

In first step S001 in the flowchart of FIG. 3, there is a standbyprocess for a fixed time such as 10 minutes. Note that a readingprocess, etc. is executed during the standby period, and hence thefrequency in use (which is the number of pieces of demodulated bar code)is counted. In step S002, executed after the fixed time has elapsed, itis checked whether the frequency in use has changed or not. In otherwords, the frequency in use during the standby process in step S001 iscalculated, and a value of the thus calculated frequency in use iscompared with a value of the frequency in use which has been recentlystored in the storage and learning unit 3. Then, if the frequency in usehas not changed, the processing is returned to step S001.

Whereas, if the frequency in use has changed, it is checked whether thefrequency in use has increased in step S003. Then, if the frequency inuse has decreased, the detection sensitivity of the proximity sensor 8is reduced corresponding to a quantity of decrease in step S004. Morespecifically, the value of the variable y for referring to thedetermination frequency table shown in FIG. 5 is decremented by 1through 4. Subsequently in next step S005, the frequency in usecalculated in step S093 of this time is stored in the storage andlearning unit 3, and the processing is returned to step S001.

Consequently, if the frequency in use has increased, the detectionsensitivity of the proximity sensor 8 is increased corresponding to aquantity of increase in step S006. More specifically, the value of thevariable y for referring to the determination frequency table shown inFIG. 5 is incremented by 1 through 4. Subsequently in next step S007,the frequency in use calculated in step S003 of this time is stored inthe storage and learning unit 3, and the processing is returned to stepS001.

On the other hand, FIG, 4 shows the processes for irradiating orstopping the laser beams L by controlling the motor 12 and the laserlight source 13, and demodulating the bar code on the basis of the barwidth data outputted from the bar width counter 16.

In first step S101 in the flowchart of FIG. 4, the motor 12 is rotated,and the unillustrated polygon mirror in the scan optical system 14 isrotationally driven.

In next step S102, a timer for measuring time during which the bar widthdata has not detected is set at 10 sec.

In next step S103, the laser light source 13 emits the laser beams L ata duty of irradiation of 100%.

In subsequent step S104, the data outputted from the bar width counter16 is monitored, and there is checked whether the bar width dataincluding a pattern corresponding to the bar code 21 is detected. Then,if the bar width data is detected, the bar code 21 has been scanned withthe laser beams L. Hence, in next step S118, the timer is reset at 10and, in step S119, the demodulation based on the detected bar width datais executed (corresponding to a demodulating element). In other words,this item of bar width data is converted into corresponding data.

Checked in next step S120 is whether the demodulation in step S119 iscompleted. Then, if the demodulation is not completed, the processinggoes back to step S104 to carry out a process for the next bar widthdata. Whereas if completed, in step S121, the demodulated data istransmitted via the interface circuit 9 to the host computer 22. Whenthis transmission is finished, the processing is returned to step S104to perform the process for the next bar width data.

Whereas if the bar width data is not detected in step S104, It ischecked in step S105 whether time of 10 sec. has elapsed since the barwidth data has not been detected. Then, if the time of 10 sec. has notyet elapsed, the processing goes back to step S104 to check an existenceof the bar width data. cortrastingly If the time of 10 sec. has alreadyelapsed, in step S106, the auto-off control unit 6 is instructed toreduce, the duty of irradiation of the laser beams L emitted from thelaser light source 13 to 50% (corresponding to an power changing elementand a controlling element).

In next step S107, the detection sensitivity of the proximity sensor 8is set to correspond to variable x=1. To be more specific, thedetermination threshold value table shown in FIG. 5 is referred based onthe value of the variable y set in step S004 or S006 in FIG. 3 and onthe variable x=1. Then, a corresponding determination threshold value isread and set in the proximity sensor control unit 7.

In next step S108, in the same way as step S104, the data outputted fromthe bar width counter 16 is monitored, and there is checked whether thebar width data including the pattern corresponding to the bar code 21 isdetected. Then, if the bar width data is detected, the bar code 21 hasbeen scanned with the laser beams L. Hence, the processing is returnedto step S102 in order to set, the duty of irradiation of the laser beamsL outputted from the laser light source 13 again to 100%. Note that abar width data is again detected (S104) after the duty of irradiation ofthe laser beams L has been set back to 100%, and hence the bar widthdata detected in step S108 of this time is discarded of without beingdemodulated (S119)

If the bar width data is not detected, in step S109, whether theproximity sensor 8 detects a proximity of an object is checked based onthe notice given from the proximity sensor control unit 7. The proximityof the object is detected by use of a detection sensitivity (which isthe determination threshold value) set in step S107. Then, if theproximity of the object is detected, there is such a possibility thatthis object may be the goods 20 having the bar code 21, and thereforethe processing is returned to step S102 to set, the duty of irradiationof the laser beams L emitted from the laser light source 13 again to100% (corresponding toga restoring element and a restoring element).

If the proximity of the object is not detected, it is checked in stepS110 whether time elapsed with no detection of any object since thecheck in step S109 has started reaches 9 minutes and 50 seconds. Then,if time of 9 minutes and 50 seconds has not yet elapsed, the processingreturns to step S108 to continue the check as to whether the bar widthdata is detected or not.

Constrastingly, if the time elapsed with no detection of any objectreaches 9 minutes and 50 seconds, in step Sill, the auto-off controlunit 6 is instructed to completely stop the emission of the laser beamsL from the laser light source 13 (corresponding to the controllingelement).

Subsequently in step S112, the detection sensitivity of the proximitysensor 8 is set to a sensitivity corresponding to the variable x=2. Morespecifically, the determination threshold value table shown in FIG. 5 isreferred based on the value of the variable y set in step S004 or S006in FIG. 3 and on the variable x=2. Then, a corresponding determinationthreshold value is read and set in the proximity sensor control unit 7.

In next step S113, whether the proximity sensor 8 detects the proximityof the object is checked based on the notice given from the proximitysensor control unit 7. The proximity of the object is detected by use ofthe detection sensitivity (which is the determination threshold value)set in step S112. Then, if the proximity of the object is detected,there is such a possibility that this object may be the goods 20 havingthe bar code 21, and therefore the processing is returned to step S102to set the duty of irradiation of the laser beams L outputted from thelaser light source 13 again to 100%.

If the proximity of the object is not detected, there is checked in stepS114 whether the time elapsed with no detection of any object since thecheck in step S113 has started reaches 20 minutes. Then, if a time of 20minutes has not yet elapsed, the processing returns to step S113 tocontinue the check as to whether the bar width data is detected or not.

Contrastingly, if the time elapsed with no detection of any objectreaches 20 minutes, in step S115, the auto-off control unit 6 isinstructed to stop the motor 27 (corresponding to the controllingelement).

Subsequently in step S116, the detection sensitivity of the proximitysensor 8 is set to a sensitivity corresponding to the variable x=3. Morespecifically, the determination threshold value table shown in FIG. 5 isreferred based on the value of the variable y set in step S004 or S006in FIG. 3 and on the variable x=3. Then, a corresponding determinationthreshold value is read and set in the proximity sensor control unit 7.

In step S117, whether or not the proximity sensor 8 detects theproximity of the object is checked based on the notice given from theproximity sensor control unit 7. The proximity of the object is detectedby use of the detection sensitivity (which is the determinationthreshold value) set in step S116. Then, if the proximity of the objectis detected, there is a possibility that this object may be the goods 20having the bar code 21, and therefore the processing is returned to stepS101 to resume the rotations of the motor 12 and to set the duty ofirradiation of the laser beams L emitted from the laser light source 13again to 100% (corresponding to the restoring element and the restoringelement). If the proximity of the object is not detected, this checkingprocess continues to be done without performing other processes untilthe proximity of the object is detected.

Next, the operation of the bar code reading apparatus in accordance withthe first embodiment will be explained with reference to FIG. 7. Now, itis assumed that no bar width data is detected at all since a last pieceof bar width data has been demodulated at a point of a time 0. Then, asindicated by a graph in the upper part of FIG. 7, the duty ofirradiation of the laser beams L emitted from the laser light source 13drops down to 50% after 10 seconds, the emission of the laser beams L iscompletely stopped after 10 minutes, and the motor 12 also stops after30 minutes.

Then, during such a period (dm1) for which the duty of irradiation ofthe laser beams L is 100%, the bar code is always readable, and hencethe proximity sensor 8 does not detect the proximity of the object.

Further, during such a period (dm2) for which the duty of irradiation ofthe laser beams L is 50%, the bar width counter 16 is capable ofgenerating the bar width data. When the bar width data is obtained, theduty of irradiation of the laser beams L is set back to 100% in order toresume the reading of the bar code (S108).

Moreover, during the period (dm2) for which the duty of irradiation ofthe laser beams L is 50%, the proximity sensor 8 is capable of detectingthe proximity of the object (S109). Then, the determination thresholdvalue on this occasion is the lowest one that is set for the samefrequency in use, while the sensitivity of the proximity sensor 8 ishighest. The first reason therefor is that the possibility of the barcode being subsequently read is high because of only a comparativelyshort period of time having passed since the last bar width data hadbeen detected, and therefore, a possibility of misdetecting an objectother than the goods 20 remains relatively low even if the determinationthreshold value is decreased. The second reason therefor is that theduty of irradiation of the laser beams L merely fluctuates, with theresult that a trouble caused by the misdetection is comparatively smalleven if an object other than the goods 20 having the bar code 21 ismisdetected. Additionally, the lower the frequency in use because thehigher the determination threshold value becomes, and the lower thesensitivity of the proximity sensor 8 becomes. This is derived from thefact that the possibility of the bar code being read becomes smaller asthe frequency in use gets lower even if the time elapsed since the lastbar width data has been detected is the same.

During a period (which is called a laser time-out) for which the motor12 still rotates although the emission of the laser beams L iscompletely stopped, what is possible is only the detection of the objectproximity by the proximity sensor 8 (S113). The determination thresholdvalue on this occasion is higher than a value set for the duty ofirradiation 50% at the same time frequency in use. Accordingly, thesensitivity of the proximity sensor 8 is lower than the sensitivity atthe duty of irradiation 50%. The first reason therefore is that thepossibility of the bar code being subsequently read is low because of aconsiderable period of time having passed since the last bar width datahad been detected, and therefore, the possibility of misdetecting theobject other than the goods 20 having the bar code 21 relatively high ifwhen the determination threshold value is left as it is. The secondreason therefore is that there is no alternative but to interrupt otherprocesses until the laser light source 13 is excited and the emission ofthe laser beams L is stabilized if the object other than the goods 20having the bar code 21 is misdetected and therefore the trouble causedby the misdetection is comparatively large. The lower the frequency inuse the higher the determination threshold value becomes, and the lowerthe sensitivity of the proximity sensor 8 goes. This is derived from thefact that the possibility of the bar code being read becomes smaller asthe frequency in use gets lower even if the time elapsed since the lastbar width data has been detected is the same.

During a period for which both the emission of the laser beams L and therotations of the motor 12 are completely stopped, referred to as a motortime-out, only the detection of the proximity of the object by theproximity sensor 8 (S117) is possible. Then, the determination thresholdvalue at this time is, as shown in FIG. 5, the highest one that is setfor the same frequency in use. Accordingly, the sensitivity of theproximity sensor 8 is lowest. This is because the process must beexecuted from re-driving of the motor 12 when detecting the proximity ofthe object due to the halt of the motor 12 in step S115 at this point oftime, and because the trouble caused by the misdetection is large onaccount of an impossibility of performing other processes until thestate of the rotations of the motor and the state of the laser beams Lare stabilized. In this case, the determination threshold value isalways high while the sensitivity of the proximity sensor 8 remains lowat all times irrespective of the frequency in use. The reason for thisis that a time of 30 or more minutes has elapsed since no bar code hadbeen detected, and consequently there is no necessity for consideringthe frequency in use any more.

Thus, in accordance with the first embodiment, it is feasible to detectthe proximity of the object with an optimum sensitivity and to resumethe emission of the laser beams L and also the rotations of the motor 12on the basis of the trouble caused by the misdetection depending on thestate of the emission of the laser beams L and the state of therotations of the motor 12, and on the basis of the possibility ofreading the bar code expected in view of the time elapsed since the lastbar width data has been detected.

A second embodiment of the present invention is, as compared with thefirst embodiment discussed above, characterized by using an externallight sensor for detecting a brightness of external light by way of theproximity sensor 8. The proximity sensor 8 in this case is constructedof only a photo diode exhibiting a flat frequency characteristic in avisible area. Then, the proximity sensor control unit 7 connected tothis proximity sensor 8 detects, as illustrated in FIG. 9, a proximityof the object on the basis of what percentage a quantity of receivedlight (an external light quantity) is reduced on the assumption that thequantity of received light (the external light quantity) in a normaltime is set to 100%.

Accordingly, in this case, determination threshold values written in adetermination threshold table stored in the ROM 5 show rates of anattenuation of light quantity to the light quantity of 100%. A detectionsensitivity based thereon; however, decreases with a passage of timesince the bar width data is detected last time and with a drop infrequency in use as in same way with the case of the reflection typesensor in accordance with the first embodiment. During a motor time-outperiod, the detection sensitivity has always the minimum valueregardless of a magnitude of the frequency in use, as shown in FIG. 10.

Other configurations and functions in the second embodiment areabsolutely the same as those in the first embodiment, and explanationsthereof are omitted.

A third embodiment involves a hardware architecture using an externallight brightness detecting type of proximity sensor 8 that is absolutelyidentical with the proximity sensor 8 used in the second embodimentdiscussed above. A process executed by the CPU 1 in the third embodimentis to simply set the duty of irradiation of the laser beams L to 50%without halting both the emission of the laser beams L and the rotationsof the motor 12 even if there would be no detection of the object by theproximity sensor 8 for a long period of time. Further, unlike such aprocess in the second embodiment that the sensitivity of the proximitysensor 8 is decreased with the drop in the frequency in use, a processin accordance with the third embodiment is that the sensitivity of theproximity sensor 8 is decreased only when a fixed time elapses while nodetection of the bar code is made.

FIG. 11 shows the processes executed by the CPU 1 in accordance with thethird embodiment. These processes start with a power supply to the barcode reading apparatus. In first step S201, each of numeral values usedfor those processes is initialized. More specifically, the"determination threshold value" used when a proximity of an objectdetected based on a reduction in the external light quantity measured bythe proximity sensor 8 is set a constant α (0.9). If this "determinationthreshold value" is set to the constant α (0.9), the detectionsensitivity of the external light sensor 8 comes to 90%. Further, the"time β" corresponding to a time until the "determination thresholdvalue" is changed is set to 10 minutes. Set further to 100 ms is the"interval γ" corresponding to a time interval for sampling quantity ofthe light detected by the proximity sensor 8 for measuring an averagevalue of the external light quantities. Then, the external lightsampling at the interval γ (100 ms) is started, and a monitoring timerfor monitoring an elapsed time is also started. This time monitoringtimer may be a software timer.

In next step S202, the motor 12 starts rotating, and an unillustratedpolygon mirror in the scan optical system 14 is rotationally driven.

In next step S203, whether an elapsed time monitored by the monitoringtimer reaches the time β (10 minutes) is checked. Then, if the time β(10 minutes) is not yet reached, the processing proceeds directly tostep S205. Whereas if the time β (10 minutes) has already been reached,in step S204, the "determination threshold value " is changed from theconstant α (0.9) to a constant δ (0.8), and the detection sensitivity ofthe external light sensor 8 is set to 80% (which corresponds to asensitivity decreasing element). Thereafter, the processing proceeds tostep S205.

In step S205, the laser light source 13 emits the laser beams L at aduty of irradiation of 100%.

In next step S206, the data outputted from the bar width counter 16 ismonitored, and it is checked whether or not the bar width data includingthe pattern corresponding to the bar code 21 is detected. Then, if thebar width data is detected, it is Judged that the bar code 21 is scannedwith the laser beams L, and hence the processing proceeds to step S212.In step S212, in absolutely the same manner as step S201, a variety ofnumerical values used in this processing are initialized. In next stepS213, the demodulation based on the detected bar width data is carriedout (corresponding to a demodulating element). In other words, the barwidth data is converted into corresponding data. Checked in next stepS214 is whether the demodulation in step S213 has completed or not.Then, if the demodulation has not completed, the processing is returnedto step S206 to execute a process for the next bar width data.Contrastingly if the demodulation is completed, in step S215, thedemodulated data is transmitted via the interface circuit 9 to the hostcomputer 22. When this transmission has done, the processing is returnedto step S206 to execute a process for the next bar width data.

Whereas if no bar width data is detected in step S206, it is checked instep S207 whether the time of 10 sec. has elapsed since the bar widthdata has detected last time. Then, if the time of 10 sec. has not yetelapsed, the processing goes back to step S206 to check an existence ofthe bar width data. Contrastingly if the time of 10 sec. has alreadyelapsed, in step S208, the auto-off control unit 6 is instructed toreduce the duty of irradiation of the laser beams L emitted from thelaser light source 13 to 50% (corresponding to the power changingelement and the controlling element).

In step S209, as in step S206, the data outputted from the bar widthcounter 16 is monitored, and there is checked whether the bar width dataincluding the pattern corresponding to the bar code 21 is detected.Then, if the bar width data is detected, it is judged that the bar code21 is scanned-with the laser beams L. Hence, the processing is returnedto step S203 in order to restore the duty of irradiation of the laserbeams L outputted from the laser light source 13 to 100%, Note that thenumerical values, which are determination threshold values, areinitialized in step S210 when the processing returns to step S203, andtherefore the detection sensitivity of the proximity sensor 8 hereafterbecomes 90%.

If no bar width data is detected, in step S211, whether an objectapproaches the front of the proximity sensor 8 is checked based on thenotice given from the proximity sensor control unit 7. Morespecifically, nine pieces of latest values among the external lightquantity values obtained by sampling at every interval of γ (100 ms) areaveraged, thereby an "average value ε" is obtained. Next, the externallight quantity at the present time is sampled at a sampling interval of10 ms, and the sampled light quantity is set to the "sampled value ζ".After the above processing, there is checked whether the above-described"determination threshold value", the "average value ε" and the "sampledvalue ζ" satisfy the following formula (1).

    Average Valueε×Determination Threshold Values ≧Value(1)

If this formula is satisfied, it is judged that the present lightquantity (which is the sampled value) is not more than X% (which is 90%when the determination threshold value is set to the constant α or 80%when it is set to the constant δ) of the light quantity previous to thepoint of time (which is the average value ε). Accordingly, it is judgedthat an object approaches the front of the external light sensor 8.Then, if it is judged that an object approaches (if the external lightquantity is X% or under), the processing is returned to S203 in order torestore the duty of irradiation of the laser beams L emitted from thelaser light source 13 to 100%. This case does not imply that the barwidth data itself is detected, and therefore, no numerical value(threshold value) is initialized. Accordingly, the detection sensitivityof the proximity sensor 8 remains as it is. Contrastingly, if it isjudged that no object approaches the front (if the external lightquantity exceeds X%), the processing returns to step S209.

Next, the operation of the bar code reading apparatus in the thirdembodiment will be explained. Now, it is assumed that no bar width datais absolutely detected after the bar width data has been demodulatedlast time. In this case, the duty of irradiation of the laser beams Lemitted from the laser light source 13 is reduced down to 50% whenelapsed time reaches 10 sec. since the bar width data has beendemodulated last time.

During such a period for which the duty of irradiation of the laserbeams L is 50%, the bar width counter 16 is capable of generating thebar width data. When the bar width data is obtained, the duty ofirradiation of the laser beams L is set back to 100% in order to resumethe reading of the bar code (S209, S205).

Further, during the period for which the duty of irradiation of thelaser beams L is 50%, the proximity sensor 8 is also capable ofdetecting a proximity of an object (S211). In the initial status, thedetermination threshold value for the proximity sensor 8 to detect theproximity of an object is 90% of the average value (the average value ε)of the normal external light quantity.

If the bar width data is detected after the proximity sensory 8 hasdetected the proximity an the object, in step S212, the "determinationthreshold value" is initialized. If the bar width data is not detectedafter the proximity sensory 8 has detected the proximity of an object,however, this can be recognized as a misdetection, and therefore the"determination threshold value" is not initialized. Then, when theelapsed time reaches 10 minutes (a time β) while no initialization ofthe "determination threshold value" is made, in step S204, the"determination threshold value" comes to 80% of the average value(average value ε) of the normal external light quantity. In other words,the detection sensitivity of the proximity sensor 8 decreases. This isdue to the fact that the possibility of reading the bar code 21 becomeslower as the elapsed time becomes longer since the bar width data wasdetected last time, and the fact that there relatively increases apossibility of misdetecting an object other than the goods 20 includingthe bar code 21 if the determination threshold value remains as it is.Incidentally, as discussed above, the "determination threshold value"is, even after reduced to 80%, immediately initialized in step S212 andset back to 90% on the condition that the bar width data is detected.

Note that in the above-described determination about the proximity ofthe object in step S209, the "sampled value ζ" substituted into theformula (1) may be replaced with an average value of the latest threevalues among the external light quantity values sampled at the intervalof 10 ms.

A characteristic of a fourth embodiment of the present invention is, ascompared with the third embodiment discussed above, that the number ofmisdetections of the proximity f the object by the proximity sensor 8(S303 is used as the trigger for decreasing the "determination thresholdvalue"). Other configurations in the fourth embodiment are absolutelythe same as those in the third embodiment.

FIG. 12 shows the processes executed by the CPU 1 in the fourthembodiment. These processes start with the power supply to the bar codereading apparatus. In first step S301, each of the numeral values usedfor those processes is initialized. More specifically, the"determination threshold value" used when a proximity of an objectdetected based on the reduction in the external light quantity measuredby the proximity sensor. 8 is set to a constant value α (0.9). If this"determination threshold value" is set to the constant α (0.9), thedetection sensitivity of the external light sensor 8 comes to 90%.Further, the "number-of-times η" corresponding to the number ofmisdetections of the proximity of the object until the "determinationthreshold value" is changed is set to 30 times. Set further to 100 ms isan "interval γ" corresponding to the time interval for sampling quantityof the light detected by the proximity sensor 8 for measuring theaverage value of the external light quantities. Then, the external lightsampling at the interval δ (100 ms) is started.

In next step S302, the motor 12 starts rotating, and the polygon mirrorin the scan optical system 14 is rotationally driven.

In step S303, whether the number of misdetections of a proximity of anobject by the proximity sensor 8 reaches the number-of-times η (30times) is checked. Then, if it does not reach the number-of-times η (30times), the processing proceeds directly to step S305. Whereas if thenumber-of-times η (30 times) has already been reached, in step S304, the"determination threshold value" is changed from the constant α (0.9) tothe constant δ (0.8), and the detection sensitivity of the externallight sensor 8 is set to 80% (corresponding to the sensitivitydecreasing element). Thereafter, the processing proceeds to step S305.

In step S305, the laser light source 13 emits the laser beams L at theduty of irradiation of 100%.

In step S306, the data outputted from the bar width counter 16 ismonitored, and it is checked whether or not the bar width data includingthe pattern corresponding to the bar code 21 is detected, is checked.Then, if the bar width data is detected, it is judged that the bar code21 is scanned with the laser beams L, and hence the processing proceedsto step S312. In step S312, in the same manner as step S301, a varietyof numerical values used in this processing are initialized. In stepS313, the demodulation based on the detected bar width data is carriedout (corresponding to the demodulating element). In other words, theitem of bar width data is converted into corresponding data. Checked innext step S314 is whether the demodulation in step S313 has completed ornot. Then, if the demodulation has not completed, the processing isreturned to step S306 to execute a process for the next bar width data.Contrastingly, if the demodulation has completed, in step S315, thedemodulated data is transmitted via the interface circuit 9 to the hostcomputer 22. When this transmission is done, the processing is returnedto step S306 to execute a process for the next bar width data.

Whereas if no bar width data is detected in step S306, it is checked instep S207 whether the time of 10 sec. has elapsed since the bar widthdata hast detected last time. Then, if the time of 10 sec. Has not yetelapsed, the processing goes back to step S306 to check an existence ofthe bar width data. Contrastingly, if the time of 10 sec. has alreadyelapsed, in step S308, the auto-off control unit 6 is instructed toreduce the duty of irradiation of the laser beams L emitted from thelaser light source 13 to 50% (corresponding to the power changingelement and the controlling element).

In step S309, in the same way as step S306, the data outputted from thebar width counter 16 is monitored, and there is checked whether the barwidth data including the pattern corresponding to the bar code 21 isdetected. Then, if the bar width data is detected, it is judged that thebar code 21 is scanned with the laser beams L. Hence, the processing isreturned to step S303 in order to restore the duty of irradiation of thelaser beams L outputted from the laser light source 13 to 100%(corresponding to the restoring element and the restoring element). Whenthe processing returned to step S303, however, the numerical values(which are the determination threshold values) are initialized in stepS310, and hence the detection sensitivity of the proximity sensor 8hereafter becomes 90%.

Whereas if no bar width data is detected, in step S311, whether anobject approaches the front of the proximity sensor 8 is checked basedon the notice given from the proximity sensor control unit 7. Morespecifically, nine pieces of latest values among the external lightquantity values obtained by sampling at every interval of γ (100 ms) areaveraged, thereby an "average value ε" is obtained. Next, the externallight quantity at the present time is sampled at the sampling intervalof 10 ms, and the sampled light quantity is set to the "sampled valueζ". After the above processing, there is checked whether theabove-described "determination threshold value", the "average value ε"and the "sampled value ζ" satisfy the formula (1) given above. If theabove formula is satisfied, it is judged that the present light quantity(which is the sampled value) is not more than X% (which is 90% when thedetermination threshold value is set to the constant value α and 80%when it is set to the constant δ) of the light quantity previous to thepoint of time (which is the average value ε). Accordingly, it is judgedthat an object approaches the front the front of the external lightsensor 8. Then; if it is judged that an object approaches the front (ifthe external light quantity is X% or under), the processing is returnedto S303 in order to restore the duty of irradiation of the laser beams Lemitted from the laser light source 13 to 100% (corresponding to therestoring element and the restoring element). This case does not,however, imply that the bar width data itself is detected, andtherefore, no numerical value (threshold value) is initialized.Accordingly, the detection sensitivity of the proximity sensor 8 remainsas it is. Contrastingly, if it is judged that no object approaches thefront (if the external light quantity exceeds X%), the processingreturns to step S309.

Next, the operation of the bar code reading apparatus in the fourthembodiment will be discussed. Now, it is assumed that no bar width datais detected after the bar width data has been demodulated last time. Inthis case, the duty of irradiation of the laser beams L emitted from thelaser light source 13 is reduced down to 50% when elapsed time reaches10 sec. since the bar width data has been demodulated last time.

During a period for which the duty of irradiation of the laser beams Lis 50%, the bar width counter 16 is capable of generating the bar widthdata. When the bar width data is obtained, the duty of irradiation ofthe laser beams L is set back to 100% in order to resume the reading ofthe bar code (S309, S305).

Further, during the period for which the duty of irradiation of thelaser beams L is 50%, the proximity sensor 8 is also capable ofdetecting a proximity of an object (S311). In the initial status, thedetermination threshold value for the proximity sensor 8 to detect theproximity of an object is 90% of the average value (the average value ε)of the normal external light quantity.

If the bar width data is detected after the proximity sensor 8 hasdetected the proximity of an object, in step S312, the "determinationthreshold value" is initialized. If the bar width data is not detectedafter the proximity sensor 8 has detected the proximity of an object,however, this can be recognized as a misdetection, and therefore the"determination threshold value" is not initialized. Then, when thenumber of misdetections reaches the number-of-times η (30 times), instep S304, the "determination threshold value" becomes 80% of theaverage value (the average value ε) of the normal external lightquantity. In other words, the detection sensitivity of the proximitysensor 8 decreases. This is due to the fact that an undetectable time ofthe bar width data elongates and therefore the possibility of readingthe bar code 21 becomes lower as the number of misdetections increases,and the fact that there relatively increases the possibility ofmisdetecting an object other than the goods 20 including the bar code 21if the determination threshold value remains as it is. Incidentally, asdiscussed above, the "determination threshold value" is, even afterreduced to 80%, immediately initialized in step S312 and set back to 90%on the condition that the bar width data is detected.

Note that in the above-described determination about the proximity ofthe object in step S309, the "sampled value ζ" substituted into theformula (1) may be replaced with an average value of the latest threevalues among the external light quantity values sampled at the intervalof 10 ms.

A fifth embodiment of the present invention involves, in absolutely thesame manner as the second embodiment discussed above, the use of thehardware architecture using the external light brightness detection typeof proximity sensor 8. In the processes executed by the CPU 1 in thefifth embodiment, however, there are performed neither the detection ofthe frequency in use (FIG. 3) nor the change in the sensitivity of theproximity sensor 8 in accordance with the variations in the frequency inuse. Instead, in accordance with the fifth embodiment, when theproximity sensor 8 detects the object without detecting the bar widthdata, there is reduced a length of the period for which the duty ofirradiation of the laser beams L is 50%, i.e., a time until the emissionof the laser beams L is stopped. Note that a "status A" indicates astatus where the duty of irradiation of the laser beams L is 100%, a"status B" indicates a status where the duty of irradiation of the laserbeams L is 50%, a "status C" indicates a status where the emission ofthe laser beams L is stopped with the motor 12 rotated and a "status D"indicates a status where the motor 12 stops, in the fifth embodiment.Other configurations in the fifth embodiment are absolutely the same asthose in the second embodiment.

FIG. 13 shows the processes executed by the CPU 1 in the fifthembodiment. These processes start with the power supply to the bar codereading apparatus. In first step S401, each of numeral values used forthose processes is initialized. More specifically, the "time a"corresponding to a transition time from the status A to the status B isset to 10 sec. The "time b" corresponding to a transition time from thestatus B to the status C is set to 9 minutes and 50 seconds. The "timec" corresponding to a transmission time from the status C to the statusD is set to 20 minutes. The "determination threshold value" used when aproximity of an object is detected based on the reduction in theexternal light quantity measured by the proximity sensor 8 is setfurther to a constant α (0.9). The "interval γ" corresponding to a timeinterval for sampling the quantity of the light detected by theproximity sensor 8 for measuring an average value of the external lightquantities is set to 100 ms. Then, the external light sampling at theinterval γ (100 ms) is started, and the monitoring timer for monitoringan elapsed time is also started. This monitoring timer may be a softwaretimer.

In next step S402, the motor 12 starts rotating, and the polygon mirrorin the scan optical system 14 is rotationally driven.

In next step S403, whether the external light sensor 8 detects aproximity of an object is checked. Then, if the proximity of an objectis detected, in step S404, one of the status transition times ischanged. To be specific, the time set to the "time b" is changed to 10sec. (corresponding to a time setting element). Thereafter, theprocessing proceeds to step S405. Whereas if the proximity of an objectremains undetected, the processing proceeds directly to step S405.

In step S405, the laser light source 13 emits the laser beams L at theduty of irradiation of 100%.

In next step S406, the data outputted from the bar width counter 16 ismonitored, and it is checked whether or not the bar width data includingthe pattern corresponding to the bar code 21 is detected. Then,.if thebar width data is detected, it is judged that the bar code 21 is scannedwith the laser beams L, and hence the processing proceeds to step S412.In step S412, in the same manner as step S401, a variety of numericalvalues used in this processing are initialized. In next step S413, thedemodulation based on the detected bar width data is carried out(corresponding to the demodulating element). In other words, the barwidth data is converted into corresponding data. Checked in step S414 iswhether the demodulation in step S413 has completed or not. If thedemodulation has not completed, the processing is then returned to stepS406 to execute a process for the next bar width data. Contrastingly, ifthe demodulation has completed, in step S415, the demodulated data istransmitted via the interface circuit 9 to the host computer 22. Whenthis transmission has done, the processing is returned to step S406 toexecute a process for the next bar width data.

If no bar width data is detected in step S406, it is checked in step 407whether the time a (10 sec.) has elapsed since the bar width data hasdetected last time. Then, if the time a (10 sec.) has not yet elapsed,the processing goes back to step S406 to check an existence of the barwidth data. Contrastingly if the time a (10 sec.) has already elapsed,in step S408, the auto-off control unit 6 is instructed to reduce theduty of irradiation of the laser beams L emitted from the laser lightsource 13 to 50% (corresponding to the power changing element and thecontrolling element).

In next step S409, in the same way as step S406, the data outputted fromthe bar width counter 16 is monitored, and there is checked whether thebar width data including the pattern corresponding to the bar code 21 isdetected. Then, if the bar width data is detected, it is judged that thebar code 21 is scanned with the laser beams L. Hence, the processing isreturned to step S403 in order to restore the duty of irradiation of thelaser beams L emitted from the laser light source 13 to 100%(corresponding to the restoring element and the restoring element).However, the numerical value (time b) is initialized in step S410 whenthe processing returns to step S403, and therefore the "time b"hereafter becomes 9 minutes and 50 seconds.

Whereas if no bar width data is detected, it is checked in step S411whether the time elapsed without detecting the bar width data after thecompletion of checking in step S407 reaches the time b (9 minutes and 50seconds, or 10 seconds).

Then, if the time b (9 minutes and 50 seconds, or 10 seconds) is notreached, in step S416, whether an object approaches the front of theproximity sensor 8 is checked based on the notice given from theproximity sensor control unit 7. More specifically, nine pieces oflatest values among the external light quantity values obtained bysampling at every interval of γ (100 ms) are averaged, thereby an"average value ε" is obtained. Next, the external light quantity at thepresent time is sampled at the sampling interval of 10 ms, and thesampled light quantity is set to a "sampled value ζ". After the aboveprocessing, there is checked whether the above-described "determinationthreshold value", the "average value ε" and the "sampled value ζ"satisfy the above-described formula (1).

If the above formula (1) is satisfied, it is judged that the presentlight quantity (which is the sampled value) is not more than X% (90%) ofthe light quantity previous to that point of time (which is an averagevalue ε). Accordingly, it is judged that an object approaches the frontof the external light sensor 8. In this case, the processing is returnedto S403 in order to restore the duty of irradiation of the laser beams Lemitted from the laser light source 13 to 100% (corresponding to therestoring element and the restoring element). This case does not,however, imply that the bar width data itself is detected, and thereforeno numerical value (the time b) is initialized. Accordingly, the timeset to the "time b" remains as it is. Whereas if it is judged that noobject approaches the front (if the external light quantity exceeds X%),the processing returns to step S409 to detect the bar width data.

On the other hand, it is judged that the elapsed time has alreadyreached the time b (9 minutes and 50 seconds, or 10 seconds) in stepS411, the processing proceeds to step S417. In step S417, the emissionof the laser beams L from the laser light source 13 is completelystopped (corresponding to the control element).

In step S418, whether or not an object approaches the front of theproximity sensor 8 is checked based on the notice given from theproximity sensor control unit 7. More specifically, in the same way asstep S416, the "average value ε" and the "sampled value ζ" are obtained.After the obtaining, there is checked whether the above-described"determination threshold value", the "average value ε" and the "sampledvalue ζ" satisfy the following formula (2).

    Average Value ε×(Determination Threshold Value-0.1)≧Sampled value                           (2)

If this formula (2) is satisfied, it is judged that the present lightquantity previous to the point of time (which is the sampled value) isnot more than Y% (80%) of the light quantity (which is the average valueε). Accordingly, it is judged that an object approaches the front of theexternal light sensor 8. In this case, the processing is returned toS403 in order to restore the duty of irradiation of the laser beams Loutputted from the laser light source 13 to 100%. does not, however,imply that the bar width data itself is detected, and therefore, nonumerical value (the time b) is initialized. Accordingly, the time setto the "time b" remains as it is. If it is judged that no objectapproaches the front (if the external light quantity exceeds Y%), theprocessing proceeds to step S419.

Checked in step S419 is whether or not the time elapsed withoutdetecting the proximity of the object after the completion of thechecking in step S411 reaches the time c (20 minutes). Then, if the timec (20 minutes) is not reached, the processing returns to step S418.Contrastingly, it is judged that the elapsed time reaches the time c (20minutes), the processing proceeds to step S420. In step S420, the motor12 stops rotating (corresponding to the control element).

In step S421, whether an object approaches the front of the proximitysensor 8 is checked based on the notice given from the proximity sensorcontrol unit 7. More specifically, in the same manner as step S416, the"average value ε" and the "sampled value ζ" are obtained. After theobtaining, there is checked whether the above-described "determinationthreshold value", the "average value ε" and the "sampled value ζ"satisfy the following formula (3).

    Average Value ε×0.5 ≧Sampled value    (3)

If this formula (3) is satisfied, it is judged that the present lightquantity (which is the sampled value) is not more than 50% of the lightquantity previous to the point of time (which is the average value ε).Accordingly, it is judged that an object approaches the front of theexternal light sensor 8. In this case, the processing returns to stepS401 in order to resume both of the rotations of the motor 12 and theemission of the laser beams L from the laser light source 13(corresponding to the restoring element and the restoring element). Inthis case, the numerical value (the time b) is initialized, and hencethe time set to the "time b" is set back to 9 minutes and 50 seconds.Whereas if it is judged that no object approaches (if the external lightquantity exceeds Y%), the checking process in step S421 is repeated.

Next, the operation of the bar code reading apparatus in the fifthembodiment will be explained. Now, it is assumed that no bar width datais absolutely detected after the bar width data has been demodulatedlast time. Hereupon, the duty of irradiation of the laser beams Lemitted from the laser light source 13 is reduced to 50% when elapsedtime reaches 10 sec. since the bar width data has been demodulated lasttime.

During such a period for which the duty of irradiation of the laserbeams L is 50% (status B), the bar width counter 16 is capable ofgenerating the bar width data. When the bar width data is obtained, theduty of irradiation of the laser beams L is set back to 100% in order toresume the reading of the bar code (S409).

During the period for which the duty of irradiation of the laser beams Lis 50% (status B), the proximity sensor 8 is also capable of detecting aproximity of an object (S416). The determination threshold value for theproximity sensor 8 to detect the proximity of the object used duringthat period is 90% of average value (the average value ε) of the normalexternal light quantity.

When the time elapsed since the timing of becoming the status B reaches9 minutes and 50 seconds, the emission of the laser beams L iscompletely stopped (step S417). During such a period for which theemission of the laser beams 1 is completely stopped (status C), what ispossible is only the detection of the proximity of the object by theproximity sensor 8 (step S418). The determination threshold value fordetecting the proximity of the object by the proximity sensor 8 usedduring that period is 80% of the average value (the average value ε) ofthe normal external light quantity.

When the time elapsed since the timing of becoming the status C reaches20 minutes, the motor 12 also stops rotating (step S420). During such aperiod that the motor 12 stops rotating (status D), what is possible isonly the detection of the proximity of an object by the proximity sensor8 (step S421). The determination threshold value for detecting theproximity of the object by the proximity sensor 8 used during thatperiod is 50% of the average value (the average value ε) of the normalexternal light quantity.

When the proximity sensor 8 detects the proximity of the object during aperiod for which it is the status-B or status-C, the time bcorresponding to the period for which the duty of irradiation of thelaser beams L is 50% is changed to 10 seconds (step S404). Then, if nobar width data is thereafter detected, it is possible to determine thatthere must be a misdetection by the proximity sensor 8. Hence,hereafter, the laser beams L are emitted at the duty of irradiation of100% for 10 seconds and also emitted at the duty of irradiation of 50%for 10 seconds. Thereafter, the emission of the laser beams L is halted.An unnecessary emission of the laser beams L can be thereby prevented.

Contrastingly, when the bar width data is detected after the proximitysensor 8 has detected the proximity of an object, the "time b" is setback to the initial value (9 minutes and 50 seconds).

Note that in the determination about the proximity of the object insteps S416, S418 or step S421, the "sampled value ζ" substituted intothe formulae (1) through (3) may be replaced with an average value ofthe latest three values among the external light quantity values sampledat the interval of 10 ms.

A sixth embodiment of the present invention is, as compared with thefifth embodiment discussed above, characterized by changing all thestatus transition times (the time a, the time b and the time c) when theproximity sensor 8 detects the proximity of an object. Otherconfigurations in the sixth embodiment are absolutely the same as thosein the fifth embodiment.

FIG. 14 shows processes executed by the CPU 1 in the sixth embodiment.These processes start with the power supply of the bar code readingapparatus. In first step S501, each of the numeral values used for thoseprocesses is initialized. More specifically, the "time a" correspondingto a transition time from the status A to the status B is set to 10 sec.The "time b" corresponding to a transition time from the status B to thestatus C is set to 9 minutes and 50 seconds. The "time c" correspondingto a transition time from the status C to the status D is set to 20minutes. The "determination threshold value" used when a proximity of anobject is detected based on the reduction in the external light quantitymeasured by the proximity sensor 8 is set to a constant α (0.9). The"interval γ" corresponding to a time interval for sampling the quantityof the light detected by the proximity sensor 8 for measuring an averagevalue of the external light quantities is set to 100 ms. Then, theexternal light sampling at the interval γ (100 ms) is started, and themonitoring timer for monitoring an elapsed time is also started. Thismonitoring timer may be a software timer.

In next step S502, the motor 12 starts rotating, and the polygon mirrorin the scan optical system 14 is rotationally driven.

In next step S503, whether the external light sensor 8 detects aproximity of an object is checked. Then, if the proximity of an objectis detected, in step S504, each status transition time is changed(corresponding to the time setting element). To be specific, the timeset to the "time a" is changed to 5 sec. The time set to the "time b" ischanged to 10 sec. The time set to the "time c" is changed to 10 sec..Thereafter, the processing proceeds to step S505. Whereas if theproximity of an object is not yet detected, the processing proceedsdirectly to step S505.

In step S505, the laser light source 13 emits the laser beams L at theduty of irradiation of 100%.

In next step S506, the data outputted from the bar width counter 16 ismonitored, and it is checked or not the bar width data including thepattern corresponding to the bar code 21 is detected. Then, if the barwidth data is detected, it is checked that the bar code 21 is scannedwith the laser beams L, and hence the processing proceeds to step S512.In step S512, in absolutely the same manner as step S501, a variety ofnumerical values used in this processing are initialized. In next stepS513, the demodulation based on the detected bar width data is carriedout (corresponding to the demodulating element). In other words, the barwidth data is converted into corresponding data. Checked in next stepS514 is whether the demodulation in step S513 has completed or not.Then, if the demodulation has not completed, the processing is returnedto step S506 to execute a process for the next bar width data.Contrastingly if the demodulation has completed, in step S515, thedemodulated data is transmitted via the interface unit 9 to the hostcomputer 22. When this transmission has done, the processing is returnedto step S506 to execute a process for the next bar width data.

Whereas if no bar width data is detected in step S506, it is checked instep S507 whether the time a (10 or 5 sec.) has elapsed since the barwidth data has detected last time. Then, if the time a (10 or 5 sec.)has not yet elapsed, the processing goes back to step S506 to check anexistence of the bar width data. Contrastingly if the time a (10 or 5sec.) has already elapsed, in step S508, the auto-off control unit 6 isinstructed to reduce the duty of irradiation of the laser beams Lemitted from the laser light source 13 to 50% (corresponding to thepower changing element and the controlling element).

In next step S509, in the same way as step S506, the data outputted fromthe bar width counter 16 is monitored, and there is checked whether thebar width data including the pattern corresponding to the bar code 21 isdetected. Then, if the bar width data is detected, it is judged that thebar code 21 is scanned with the laser beams L. Hence, the processing isreturned to step S503 in order to restore the duty of irradiation of thelaser beams L emitted from the laser light source 13 to 100%. However,the numerical values (the time a, the time b and the time c) areinitialized in step S510 when the processing returns to step S503, andtherefore the "time a" hereafter becomes 10 seconds, the "time b"becomes 9 minutes and 50 seconds, and the "time c" becomes 20 minutes.

Whereas if no bar width data is detected, it is checked in step S507whether the time elapsed without detecting the bar width data after thecompletion of checking in step S507 reaches the time b (9 minutes and 50seconds, or 10 seconds).

Then, if the time b (9 minutes and 50 seconds, or 10 seconds) is notreached, in step S516 whether an object approaches the front of theproximity sensor 8 is checked based on the notice given from theproximity sensor control unit 7. More specifically, nine pieces oflatest values among the external light quantity values obtained bysampling at every interval of γ (100 ms) are averaged, thereby an"average value ε" is obtained. Next, the external light quantity at thepresent time is sampled at the sampling interval of 10 ms, and thesampled light quantity is set to a "sampled value ζ". After the aboveprocessing, there is checked whether the above-described "determinationthreshold value", the "average value 2" and the "sampled value ζ"satisfy the above-described formula (1).

If formula (1) is satisfied, it is judged that the present lightquantity (which is the sampled value) is not more than X% (90%) of thelight quantity previous to the point of time (the average value ε).Accordingly, it is judged that an object approaches the front of theexternal light sensor 8. In this case, the processing is returned toS503 in order to restore the duty of irradiation of the laser beams Loutputted from the laser light source 13 to 100% (corresponding to therestoring element and the restoring element). This case does not,however, imply that the bar width data itself is detected, andtherefore, the numerical values (the time a, the time b and the time c)are not initialized. Accordingly, the times set to the numerical values(the time a, the time b and the time c) remain as they are. Whereas ifit is judged that no object approaches the front (if the external lightquantity exceeds X%), the processing returns to step S509 to detect thebar width data.

On the other hand, it is judged that the elapsed time has alreadyreached the time b (9 minutes and 50 seconds, or 10 seconds) in stepS511, the processing proceeds to step S517. In step S517, the emissionof the laser beams L from the laser light source 13 is completelystopped (corresponding to the control element).

In next step S518, whether or not an object approaches the front of theproximity sensor 8 is checked based on the notice given from theproximity sensor control unit 7. More specifically, in the same way asstep S516, the "average value ε" and the "sampled value ζ" are obtained.After the values are obtained, there is judged whether theabove-described "determination threshold value", the "average value ε"and the "sampled value ζ" satisfy the following formula (2).

If formula (2) is satisfied, it is judged that the present lightquantity (which is the sampled value) is not more than Y% (80%) of thelight quantity previous to the point of time (which is the average valueε). Accordingly, it is judged that an object approaches the front of theexternal light sensor 8. In this case, the processing is returned toS503 in order to restore the duty of irradiation of the laser beams Lemitted from the laser light source 13 to 100% (corresponding to therestoring element). This case does not, however, imply that the barwidth data itself is detected, and therefore, no numerical values (thetime a, the time b and the time c) are initialized. Accordingly, thetimes set to the "time a", the "time b" and the "time c" remain as theyare. Whereas if it is judged that no object approaches the front (if theexternal light quantity exceeds Y%), the processing proceeds to stepS519.

Checked in step S519 is whether or not the time elapsed withoutdetecting the proximity of the object after the completion of thechecking in step S511 reaches the time c (20 minutes, or 10 seconds).Then, if the time c (20 minutes, or 10 seconds) is not yet reached, theprocessing returns to step S518. Contrastingly, it is judged that theelapsed time has already reached the time c (20 minutes, or 10 seconds),the processing proceeds to step S520. In step S520, the motor 12 stopsrotating (corresponding to the control element).

In step S521, whether an object approaches the front of the proximitysensor 8 is checked based on the notice given from the proximity sensorcontrol unit 7. More specifically, in the same manner as step S516, the"average value ε" and the "sampled value ζ" are obtained. After theobtaining, there is checked whether the above-described "determinationthreshold value", "average value ε" and the "sampled value ζ" satisfythe above formula (3).

If formula (3) is satisfied, it is judged that the present lightquantity (which is the sampled value) is not more than 50% of the lightquantity previous to the point of time (which is the average value ε).Accordingly, it is judged that an object approaches the front of theexternal light sensor 8. In this case, the processing returns to stepS501 in order to resume both of the rotations of the motor 12 and theemission of the laser beams L from the laser light source 13(corresponding to the restoring element and the restoring element). Inthis case, the numerical values (the time a, the time b and the time c)are initialized, and hence the "time a" is set to 10 sec., the "time b"is set to 9 minutes and 50 seconds, and the "time c" is set to 20minutes. Whereas if it is judged that no object approaches the front (ifthe external light quantity exceeds Y%), the checking process in stepS521 is repeated.

Next, the operation of the bar code reading apparatus in the sixthembodiment will be explained. Now, it is assumed that no bar width datais absolutely detected after the bar width data has been demodulatedlast time. Hereupon, the duty of irradiation of the laser beams Lemitted from the laser light source 13 is reduced down to 50% whenelapsed time reaches 10 sec. since the bar width data has beendemodulated last time.

During such a period for which the duty of irradiation of the laserbeams L is 50% (status B), the bar width counter 16 is capable ofgenerating the bar width data. When the bar width data is obtained, theduty of irradiation of the laser beams L is set back to 100% in order toresume the reading of the bar code (S509).

During the period for which the duty of irradiation of the laser beams Lis 50% (status B), the proximity sensor 8 is also capable of detecting aproximity of an object (S516). The determination threshold value for theproximity sensor 8 to detect the proximity of an object used during thatperiod is 90% of the average value (the average value ε) of the normalexternal light quantity.

When the time elapsed since the timing of becoming the status B reaches9 minutes and 50 seconds, the emission of the laser beams L iscompletely stopped (step S517). During such a period for which theemission of the laser beams 1 is completely stopped (status C), what ispossible is only the detection of the proximity of the object by theproximity sensor 8 (step S518). The determination threshold value fordetecting the proximity of the object by the proximity sensor 8 usedduring that period is 80% of the average value (the average value ε) ofthe normal external light quantity.

When the time elapsed since the timing of becoming the status C reaches20 minutes, the motor 12 also stops rotating (step S520). During such aperiod that the motor 12 stops rotating (status D), what is possible isonly the detection of the proximity of an object by the proximity sensor8 (step S521). The determination threshold value for detecting theproximity of the object by the proximity sensor 8 used during thatperiod is 50% of the average value (the average value ε) of the normalexternal light quantity.

When the proximity sensor 8 detects the proximity of the object during aperiod for which it is the status-B through status-D, the time acorresponding to the period for which the duty of irradiation of thelaser beams L is 100% is changed to 5 seconds, the time b correspondingto the period for which the duty of irradiation of the laser beams L is50% is changed to 10 sec., and the time c corresponding to the periodfor which both the emission of the laser beams L and the rotations ofthe motor 12 remain stopped (step S504). Then, if no bar width data isthereafter detected, it is possible to determine that there must be amisdetection by the proximity sensor 8. Hence, hereafter, the laserbeams L are emitted at the duty of irradiation of 100% for only 5seconds and also emitted at the duty of irradiation of 50% for only 10seconds. Thereafter, the emission of the laser beams L is halted, and,after the time of 10 sec. has elapsed, the motor 12 stops rotating. Afutile emission of the laser beams L and futile rotations of the motor12 can be thereby prevented.

Contrastingly, when the bar width data is detected after the proximitysensor 8 has detected the proximity of an object, the "time a" is setback to the initial value (10 sec.), and the "time b" is also set backto the initial value (9 minutes and 50 seconds). The "time c" is alsoset back to the initial value (20 minutes).

Note that in the determination of about the proximity of the object insteps S516, S518 or step S521, the "sampled value ζ" substituted intothe formulae (1) through (3) may be replaced with an average value ofthe latest three values among the external light quantity values sampledat the interval of 10 ms.

A seventh embodiment of the present invention is, as compared with thethird embodiment discussed above, characterized by changing the duty ofirradiation of the laser beams L only when the average light quantity isless then a predetermined value. Other configurations in the seventhembodiment are absolutely the same as those in the third embodiment.

FIG. 15 shows the processes executed by the CPU 1 in the seventhembodiment. These processes start with the power supply to the bar codereading apparatus. In first step S601, each of the numeral values usedfor those processes is initialized. More specifically, the"determination threshold value" used when a proximity of an objectdetected based on a reduction in the external light quantity measured bythe proximity sensor 8 is set to a constant α (0.9). If this"determination threshold value" is set to the constant value α (0.9),the detection sensitivity of the external light sensor 8 comes to 90%.Further, the "time β" corresponding to a time until the "determinationthreshold value" is changed is set to 10 minutes. Set further to 100 msis the "interval γ" corresponding to a time interval for sampling thequantity of the light detected by the proximity sensor 8 for measuringan average value of the external light quantities. Moreover, the "valueθ" corresponding to a determination reference value (which is a digitalvalue) of the average light quantity is set to 240 counts. Then, theexternal light sampling at the interval γ (100 ms) is started, and amonitoring timer for monitoring an elapsed time is also started. Thismonitoring timer may be a software timer.

In next step S602, the motor 12 starts rotating, and an unillustratedpolygon mirror in the scan optical system 14 is rotationally driven.

In next step S603, whether an elapsed time monitored by the monitoringtimer reaches the time β (10 minutes) is checked. Then, if the time β(10 minutes) is not yet reached, the processing proceeds directly tostep S605. Whereas if the time β (10 minutes) has already been reached,in step S604, the "determination threshold value " is changed from theconstant α (0.9) to a constant δ (0.8), and the detection sensitivity ofthe external light sensor 8 is set to 80% (which corresponds to thesensitivity decreasing element). Thereafter, the processing proceeds tostep S605.

In step S605, the laser light source 13 emits the laser beams L at aduty of irradiation of 100%.

In next step S606, the data outputted from the bar width counter 16 ismonitored, and it is checked whether or not the bar width data includingthe pattern corresponding to the bar code 21 is detected. Then, if thebar width data is detected, it is Judged that the bar code 21 is scannedwith the laser beams L, and hence the processing proceeds to step S612.In step S612, in absolutely the same manner as step S601, a variety ofnumerical values used in this processing are initialized. In next stepS613, the demodulation based on the detected bar width data is carriedout (corresponding to the demodulating element). In other words, the barwidth data is converted into corresponding data. Checked in next stepS614 is whether the demodulation in step S613 has completed or not.Then, if the demodulation is not completed, the processing is returnedto step S606 to execute a process for the next bar width data.Contrastingly if the demodulation has completed, in step S615, thedemodulated data is transmitted via the interface circuit 9 to the hostcomputer 22. When this transmission has done, the processing is returnedto step S606 to execute a process for the next bar width data.

If no bar width data is detected in step S606, it is checked in stepS607 whether the latest average of the external light quantity is notless than the predetermined determination reference value (a value θ).More specifically, nine pieces of latest values among the external lightquantity values obtained by sampling at every interval of γ (100 ms) areaveraged, thus an "average light quantity" is calculated. Thereafter,the thus calculated "average light quantity" is compared with thedetermination reference value (the value θ). Then, if the "average lightquantity" is equal to the determination reference value (the value θ) ormore, this is conceived to be beyond a controllable range of theexternal light sensor 8, and the processing returns to step S606 toprevent the misdetection.

Contrastingly, if the "average light quantity" is less than thedetermination reference value (the value θ), it is checked in step S608whether the time of 10 sec. has elapsed since the bar width data hasdetected last time. Then, if the time of 10 sec. has not yet elapsed,the processing goes back to step S606 to check an existence of the barwidth data. Contrastingly if the time of 10 sec. has already elapsed, instep S609, the auto-off control unit 6 is instructed to reduce the dutyof irradiation of the laser beams L emitted from the laser light source13 to 50% (corresponding to the power changing element and thecontrolling element).

In next step S610, in the same way as step S606, the data outputted fromthe bar width counter 16 is monitored, and there is checked whether thebar width data including the pattern corresponding to the bar code 21 isdetected. Then, if the bar width data is detected, it is judged that thebar code 21 is scanned with the laser beams L. Hence, the processing isreturned to step S603 in order to restore the duty of irradiation of thelaser beams L outputted from the laser light source 13 to 100%. When theprocessing returned to step S603, the numerical values (which are thedetermination threshold values) are initialized in step S616, and hencethe detection sensitivity of the proximity sensor 8 hereafter becomes90%.

Whereas if no bar width data is detected, in step S611, whether anobject approaches the front of the proximity sensor 8 is checked basedon the notice given from the proximity sensor control unit 7. Morespecifically, nine pieces of latest values among the external lightquantity values obtained by sampling at every interval of γ (100 ms) areaveraged, thereby the latest "average value ε" is obtained. Next, theexternal light quantity at the present time is sampled at the samplinginterval of 10 ms, and the sampled light quantity is set to the "sampledvalue ζ". After the above processing, there is checked whether theabove-described "determination threshold value", the "average value ε"and the "sampled value ζ" satisfy the formula (1) given above.

If the above formula (1) is satisfied, it is judged that the presentlight quantity (which is the sampled value) is not more than X% (whichis 90% when the determination threshold value is set to the constant αor 80% when it is set to the constant δ) of the light quantity previousto that point of time (which is the average value ε). Accordingly, it isjudged that an object approaches the front of the external light sensor8. Then, if it is judged that an object approaches the front (if theexternal light quantity is X% or under), the processing is returned toS603 in order to restore the duty of irradiation of the laser beams Lemitted from the laser light source 13 to 100%. This case does not,however, imply that the bar width data itself is detected, andtherefore, no numerical value (threshold value) is initialized.Accordingly, the detection sensitivity of the proximity sensor 8 remainsas it is. Contrastingly, if it is judged that no object approaches thefront (if the external light quantity exceeds X%), the processingreturns to step S610.

Next, the operation of the bar code reading apparatus in the seventhembodiment will be discussed. Now, it is assumed that no bar width datais absolutely detected after the bar width data has been demodulatedlast time. In this case, the duty of irradiation of the laser beams Lemitted from the laser light source 13 is reduced to 50% when elapsedtime reaches 10 sec. since the bar width data has been demodulated lasttime (S609).

During such a period for which the duty of irradiation of the laserbeams L is 50%, the bar width counter 16 is capable of generating thebar width data. When the bar width data is obtained, the duty ofirradiation of the laser beams L is set back to 100% in order to resumethe reading of the bar code (S605).

Further, during the period for which the duty of irradiation of thelaser beams L is 50%, the proximity sensor 8 is also capable ofdetecting a proximity of an object (S611). In the initial status, thedetermination threshold value for the proximity sensor 8 to detect theproximity of an object is 90% of the average value (the average value ε)of the normal external light quantity.

If the bar width data is detected after the proximity sensor 8 hasdetected the proximity of an object, in step S612, the "determinationthreshold value" is initialized. If the bar width data is not detectedafter the proximity sensory 8 has detected the proximity of an object,however, this can be recognized as a misdetection, and therefore the"determination threshold value" is not initialized. Then, when theelapsed time reaches 10 minutes (the time β) while no initialization ofthe "determination threshold value" is performed, in step S604, the"determination threshold value" becomes 80% of the average value (theaverage value ε) of the normal external light quantity. In other words,the detection sensitivity of the proximity sensor 8 decreases. This isdue to the fact that the possibility of reading the bar code 21 becomeslower as the elapsed time becomes longer since the bar width data wasdetected last time, and the fact that there relatively increases thepossibility of misdetecting an object other than the goods 20 includingthe bar code 21 if the determination threshold value remains as it is.Incidentally, as discussed above, the "determination threshold value"is, even after reduced to 80%, immediately initialized in step S612 andset back to 90% on the condition that the bar width data is detected.

If the average of the light quantity of the external light is equal tothe determination reference value (the value θ) or larger, it isconceived to be beyond the controllable range of the external lightsensor 8, and the duty of irradiation of the laser beams L remains to be100% irrespective of whether the bar width data is detected or not(S607). In this case, the processes from step S608 onward are notexecuted, and hence the duty of irradiation of the laser beams L is notchanged to 50%. Further, it is therefore unnecessary for the externallight sensor 8 to detect the proximity of an object.

Moreover, in the above-described determination about the proximity ofthe object in step S611, the "sampled value ζ" substituted into theformula (1) may be replaced with an average value of the latest threevalues among the external light quantity values sampled at the intervalof 10 ms.

An eighth embodiment of the present invention is, as compared with thethird embodiment discussed above, characterized by changing no duty ofirradiation of the laser beam L if the average light quantity is lowerthan a predetermined value. Other configurations in the eighthembodiment are absolutely the same as those in the third embodiment.

FIG. 16 shows processes executed by the CPU 1 in the eighth embodiment.These processes start with the power supply to the bar code readingapparatus. In first step S701, each of the numeral values used for thoseprocesses is initialized. More specifically, the "determinationthreshold value" used when a proximity of an object detected based on areduction in the external light quantity measured by the proximitysensor 8 is set to a constant α (0.9). If this "determination thresholdvalue" is set to the constant α (0.9), the detection sensitivity of theexternal light sensor 8 comes to 90%. Further, the "time β"corresponding to a time until the "determination threshold value" ischanged is set to 10 minutes. Set further to 100 ms is the "interval γ"corresponding to a time interval for sampling the quantity of the lightdetected by the proximity sensor 8 for measuring an average value of theexternal light quantities. Moreover, the "value τ" corresponding to adetermination reference value (which is a digital value) of the averagelight quantity is set to 20 counts. Then, the external light sampling atthe interval γ (100 ms) is started, and a monitoring timer formonitoring an elapsed time is also started. This monitoring timer may bea software timer.

In step S702, the motor 12 starts rotating, and the polygon mirror inthe scan optical system 14 is rotationally driven.

In step S703, whether an elapsed time monitored by the monitoring timerreaches the time β (10 minutes) is checked. Then, if the time β (10minutes) is not yet reached, the processing proceeds directly to stepS705. Whereas if the time β (10 minutes) has already been reached, instep S704, the "determination threshold value " is changed from theconstant α (0.9) to a constant δ (0.8), and the detection sensitivity ofthe external light sensor 8 is set to 80% (which corresponds to thesensitivity decreasing element). Thereafter, the processing proceeds tostep S705.

In step S705, the laser light source 13 emits the laser beams L at aduty of irradiation of 100%.

In next step S706, the data outputted from the bar width counter 16 ismonitored, and it is checked whether or not the bar width data includingthe pattern corresponding to the bar code 21 is detected. Then, if thebar width data is detected, it is judged that the bar code 21 is scannedwith the laser beams L, and hence the processing proceeds to step S712.In step S712, in absolutely the same manner as step S701, a variety ofnumerical values used in this processing are initialized. In next stepS713, the demodulation based on the detected bar width data is carriedout (corresponding to the demodulating element). In other words, the barwidth data is converted into corresponding data. Checked in step S714 iswhether the demodulation in step S713 has completed or not. Then, if thedemodulation has not completed, the processing is returned to step S706to execute a process for the next bar width data. Contrastingly if thedemodulation has completed, in step S715, the demodulated data istransmitted via the interface circuit 9 to the host computer 22. Whenthis transmission has done, the processing is returned to step S706 toexecute a process for the next bar width data.

If no bar width data is detected in step S706, it is checked in stepS707 whether the latest average of the external light quantity is notmore than a predetermined determination reference value (a value τ).More specifically, nine pieces of latest values among the external lightquantity values obtained by sampling at every interval of γ (100 ms) areaveraged, thus an "average light quantity" is calculated. Thereafter,the thus calculated "average light quantity" is compared with thedetermination reference value (the value τ). Then, if the "average lightquantity" is equal to the determination reference value (the value τ) orunder, this is conceived to be beyond the controllable range of theexternal light sensor 8, and the processing returns to step S706 toprevent the misdetection.

Contrastingly, if the "average light quantity" exceeds the determinationreference value (the value τ), it is checked in step S708 whether thetime of 10 sec. has elapsed since the bar width data has detected lasttime. Then, if the time of 10 sec. has not yet elapsed, the processinggoes back to step S706 to check an existence of the bar width data.Contrastingly if the time of 10 sec. has already elapsed, in step S709,the auto-off control unit 6 is instructed to reduce the duty ofirradiation of the laser beams L emitted from the laser light source 13to 50% (corresponding to the power changing element and the controllingelement).

In next step S710, in the same way as step S706, the data outputted fromthe bar width counter 16 is monitored, and there is checked whether thebar width data including the pattern corresponding to the bar code 21 isdetected. Then, if the bar width data is detected, it is judged that thebar code 21 is scanned with the laser beams L. Hence, the processing isreturned to step S703 in order to restore the duty of irradiation of thelaser beams L emitted from the laser light source 13 to 100%. When theprocessing returned to step S703, the numerical values (which are thedetermination threshold values) are initialized in step S716, and hencethe detection sensitivity of the proximity sensor 8 hereafter becomes90%.

If no bar width data is detected, in step S711, whether an objectapproaches the front of the proximity sensor 8 is checked based on thenotice given from the proximity sensor control unit 7. Morespecifically, nine pieces of latest values among the external lightquantity values obtained by sampling at every interval of γ (100 ms) areaveraged, thereby the latest "average value ε" is obtained. Next, theexternal light quantity at the present time is sampled at the samplinginterval of 10 ms, and the sampled light quantity is set to the "sampledvalue ζ". After the above processing, there is checked whether theabove-described "determination threshold value", the "average value ε"and the "sampled value ζ" satisfy the formula (1) given above.

If the above formula (1) is satisfied, it is judged that the presentlight quantity (which is the sampled value) is not more than X% (whichis 90% when the determination threshold is set to the constant α or itis set to 80% when the constant δ) of the light quantity previous to thepoint of time (which is the average value ε). Accordingly, it is judgedthat an object approaches the front of the external light sensor 8.Then, if it is judged that an object approaches (if the external lightquantity is X% or under, the processing is returned to S703 in order torestore the duty of irradiation of the laser beams L emitted from thelaser light source 13 to 100% (corresponding to the restoring elementand the restoring element). This case does not, however, imply that thebar width data itself is detected, and therefore, no numerical value(the determination threshold value) is initialized. Accordingly, thedetection sensitivity of the proximity sensor 8 remains as it is.Contrastingly, if it is judged that no object approaches the front (ifthe external light quantity exceeds X%), the processing returns to stepS710.

Next, the operation of the bar code reading apparatus in the eighthembodiment will be discussed. It will be assumed that no bar width datais absolutely detected after the bar width data has been demodulatedlast time. Hereupon, the duty of irradiation of the laser beams Lemitted from the laser light source 13 is reduced to 50% when elapsedtime reaches 10 sec. since the bar width data has been demodulated lasttime (S709).

During such a period for which the duty of irradiation of the laserbeams L is 50%, the bar width counter 16 is capable of generating thebar width data. When the bar width data is obtained, the duty ofirradiation of the laser beams L is set back to 100% in order to resumethe reading of the bar code (S705).

Further, during the period for which the duty of irradiation of thelaser beams L is 50%, the proximity sensor 8 is also capable ofdetecting a proximity of an object (S711). In the initial status, thedetermination threshold value for the proximity sensor 8 to detect theproximity of an object is 90% of the average value (the average value ε)of the normal external light quantity.

If the bar width data is detected after the proximity sensor 8 hasdetected the proximity of an object, in step S712, the "determinationthreshold value" is initialized. If the bar width data is not detectedafter the proximity sensory 8 has detected the proximity of an object,however, this can be recognized as a misdetection, and therefore the"determination threshold value" is not initialized. Then, when theelapsed time reaches 10 minutes (the time β) while no initialization ofthe "determination threshold value" is performed, in step S704, the"determination threshold value" becomes 80% of the average value (theaverage value ε) of the normal external light quantity. In other words,the detection sensitivity of the proximity sensor 8 decreases. This isdue to the fact that the possibility of reading the bar code 21 becomeslower as the elapsed time becomes longer since the bar width data wasdetected last time, and the fact that there relatively increases thepossibility of misdetecting an object other than the goods 20 includingthe bar code 21 if the determination threshold value remains as it is.Incidentally, as discussed above, the "determination threshold value"is, even after reduced to 80%, immediately initialized in step S712 andthen set back to 90% on the condition that the bar width data isdetected.

Incidentally, if the average light quantity of the external light isequal to the determination reference value (the value τ) or under, it isconceived to be beyond the controllable range of the external lightsensor 8, and the duty of irradiation of the laser beams L remains to be100% irrespective of whether the bar width data is detected or not(S707). I this case, the processes from step S708 onward are notexecuted, and hence the duty of irradiation of the laser beams L is notchanged to 50%. Further, it is therefore unnecessary for the externallight sensor 8 to detect the proximity of an object.

Moreover, in the above-described determination about the proximity ofthe object in step S711, the "sampled value 3" substituted into theformula (1) may be replaced with an average value of the latest threevalues among the external light quantity values sampled at the intervalof 10 ms.

In the respective embodiments discussed above, the bar code readingapparatus may take a form illustrated in FIG. 17. To be specific, thebar code reading apparatus may be disposed so that a glass window 11transmitting the laser beams L is directed upwards. In this case, itfollows that the goods 20 is exposed to the laser beam L at the positionabove the glass window 11.

Further, in the respective embodiments discussed above, the conditionfor setting the sensitivity of the external light sensor back to theinitial value may be a completion of the demodulation of a half of thebar code in the case that the bar code to be detected is a UPC code, ormay also be a completion of the demodulations of all the characters ofthe bar code in the case that the bar code to be detected is a secondcode.

Moreover, the embodiments discussed above may be constructed so that atime until the duty of irradiation of the laser beams L is changed, atime until the emission of the laser beams L is completely stopped, anda time until the rotations of the motor 12 are stopped can beinitialized to arbitrary values.

Note that an instant value itself of the light quantity of the laserbeams L may be attenuated instead of the duty of irradiation of thelaser beams L reduced in the respective embodiments discussed above.

The bar code reading apparatus according to the present invention havingthe above-described constructions optically detect an object marked withthe bar code. It is therefore possible to start the emission of thelaser beams and also start the driving of the scan optical systemwithout an operator aware of the existence of the sensor. Furthermore,after temporarily reading the bar code, the detection sensitivitydecreases corresponding to a length of a period for which the readingprocess of the bar code is discontinued. Consequently, the troublescaused by the misdetections can be reduced.

This invention being thus described, it will be obvious to one of skillin the art that the invention may be varied in a number ways. Suchvariations are not to be regarded as a departure from the spirit andscope of the invention, and all such medications as would be obvious toone skilled in the art are intended to be included within the scope ofthe following claims.

We claim:
 1. A bar code reading apparatus comprising:a laser lightsource for emitting a laser beam; a scan optical system deflecting thelaser beam toward a read position; demodulating means for demodulatingdata encoded in a bar code marked on an object disposed in the readposition based upon a reflected portion of the laser beam reflected fromthe bar code; power changing means for changing power of the laser beamfrom a normal level after predetermined time has elapsed since saiddemodulating means performed a previous demodulation; an optical sensoroptically detecting an object disposed in the read position; restoringmeans for restoring the power of the laser beam to the normal level whensaid optical sensor detects an object; and sensitivity decreasing meansfor decreasing sensitivity of said optical sensor in accordance with anelapsed time since said demodulating means performed the previousdemodulation.
 2. A bar code reading apparatus comprising:a laser lightsource for emitting a laser beam; a scan optical element rotating todeflect the laser beam toward a read position; driving means for drivingsaid scan optical element; demodulating means for demodulating dataencoded in a bar code marked on an object disposed in the read positionbased upon a reflected portion of the laser beam reflected from the barcode; control means for at first changing power of the laser beam from anormal level, next stopping an emission of the laser beam from saidlaser light source, and subsequently stopping the driving of said scanoptical element by said driving means in accordance with an elapsed timesince said demodulating means performed a previous demodulation lasttime; an optical sensor optically detecting an object disposed in theread position; restoring means for restoring the power of the laserbeams to the normal level, and restoring the driving of said scanoptical element by said driving means when said optical sensor detectsan object; and sensitivity decreasing means for decreasing stepwisesensitivity of said optical sensor respectively when the power of thelaser beams is changed from the normal level, when the emission of thelaser beam is stopped, and when the driving of said scan optical elementis stopped.
 3. A bar code reading apparatus according to claim 1,further comprising frequency measuring means for measuring a frequencyat which said demodulating means demodulates the data,and wherein saidsensitivity decreasing means decreases the sensitivity by said opticalsensor each time the frequency measured by said frequency measuringmeans decreases and increases the sensitivity each time the frequencyincreases.
 4. A bar code reading apparatus according to claim 3, whereinsaid sensitivity decreasing means includes a table in which the elapsedtime since said demodulating means executed the previous demodulationand the frequency measured by said frequency measuring means is combinedand made to correspond to sensitivity of said optical sensor, saidsensitivity decreasing means reading the sensitivity from the table. 5.A bar code reading apparatus according to claim 1, wherein said opticalsensor includes a light emitting element for irradiating an objectdisposed in the read position with the light beam and a light receivingelement for receiving the reflected portion of the light beam reflectedfrom the object, said light emitting element and said light receivingelement disposed side by side.
 6. A bar code reading apparatus accordingto claim 1, wherein said optical sensor is an external light sensor fordetecting external light from an external light source incident via theread position which is intercepted by the object.
 7. A bar code readingapparatus according to claim 6, wherein said optical sensor compares anaverage of light quantities obtained by measuring the external lightseveral times with a latest external light quantity, and assumes anobject to be detected when a rate of the latest external light quantitycompared to an average light quantity is a predetermined level or under.8. A bar code reading apparatus according to claim 7, wherein saidoptical sensor is configured such that an external light quantitymeasurement interval for obtaining the average is set larger than ameasurement interval for measuring the latest external light quantity.9. A bar code reading apparatus according to claim 8, wherein theaverage light quantity obtained by measuring the external light beamsseveral times is compared with a second average of light quantitiesobtained by measuring the latest external light quantities severaltimes.
 10. A bar code reading apparatus according to claim 6, whereinsaid power changing means is configured to change a power of the laserbeams only when an average light quantity obtained by measuring theexternal light several times is less than a predetermined level.
 11. Abar code reading apparatus according to claim 6, wherein said powerchanging means is configured to change a power of the laser beams onlywhen an average light quantity obtained by measuring the external lightseveral times is larger than a predetermined level.
 12. A bar codereading apparatus comprising:a laser light source for emitting a laserbeam; a scan optical system deflecting the laser beam toward a readposition; demodulating means for demodulating data encoded in a bar codemarked on an object disposed in the read position based upon of areflected beam of the laser beam reflected on the bar code; powerchanging means for changing power of the laser beam from a normal levelafter predetermined time has elapsed since said demodulating meansperformed a previous demodulation; an optical sensor optically detectingan object disposed in the read position; restoring means for restoringthe power of the laser beams to the normal level when said opticalsensor detects an object; and sensitivity decreasing means fordecreasing sensitivity of said optical sensor in accordance with anumber of times with which said optical sensor detects an object withoutany demodulation executed by said demodulating means.
 13. A bar codereading apparatus comprising:a laser light source for emitting a laserbeam; a scan optical element rotating to deflect the laser beam toward aread position; driving means for driving said scan optical element;demodulating means for demodulating data encoded in a bar code marked onan object disposed in the reading position based upon a reflected beamof the laser beam reflected on the bar code; control means for at firstchanging power of the laser beam from a normal level, next stopping anemission of the laser beam from said laser light source, andsubsequently stopping the driving of said scan optical element by saiddriving means in accordance with an elapsed time since said demodulatingmeans performed a previous demodulation; an optical sensor opticallydetecting an object disposed in the read position; restoring means forrestoring the power of the laser beam to the normal level, and restoringthe driving of said scan optical element by said driving means when saidoptical sensor detects an object; and status transition timemodification means for shortening a time before emission of the laserbeams is stopped when said optical sensor detects an object without anydemodulation executed by said demodulating means.
 14. A bar code readingapparatus comprising:a laser light source for emitting a laser beam; ascan optical element rotating to deflect the laser beam toward a readposition; driving means for driving said scan optical element;demodulating means for demodulating data encoded in a bar code marked onan object disposed in the reading position based upon a reflected beamof the laser beam reflected on the bar code; control means for at firstchanging power of the laser beam from a normal level, next stopping anemission of the laser beam from said laser light source, andsubsequently stopping the driving of said scan optical element by saiddriving means in accordance with an elapsed time since said demodulatingmeans performed a previous demodulation; an optical sensor opticallydetecting an object disposed in the read position; restoring means forrestoring the power of the laser beam to the normal level, and restoringthe driving of said scan optical element by said driving means when saidoptical sensor detects an object; and status transition timemodification means for shortening, when said optical sensor detects anobject without any demodulation executed by said demodulating means, atime until said power of the laser beam is changed a time until theemission of the laser beam is stopped, and a time until the driving ofsaid scan optical element by said driving means is stopped.